blob: 40ff7e4c55172413277c4e69cf5bd844b5d8acb3 [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"
Andreas Gampebfe63332014-11-12 14:12:45 -080021#pragma GCC diagnostic ignored "-Wunused-function"
22
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070023#include "jni.h"
Steven Moreland2279b252017-07-19 09:50:45 -070024#include <nativehelper/JNIHelp.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025#include <android_runtime/AndroidRuntime.h>
26#include <utils/misc.h>
27
28#include <assert.h>
29#include <GLES/gl.h>
Jack Palevichbe509c92009-05-07 09:52:14 -070030#include <GLES/glext.h>
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031
Jack Palevich8a4de4b2010-01-28 20:28:32 +080032// Work around differences between the generated name and the actual name.
33
34#define glBlendEquation glBlendEquationOES
35#define glBlendEquationSeparate glBlendEquationSeparateOES
36#define glBlendFuncSeparate glBlendFuncSeparateOES
37#define glGetTexGenfv glGetTexGenfvOES
38#define glGetTexGeniv glGetTexGenivOES
39#define glGetTexGenxv glGetTexGenxvOES
40#define glTexGenf glTexGenfOES
41#define glTexGenfv glTexGenfvOES
42#define glTexGeni glTexGeniOES
43#define glTexGeniv glTexGenivOES
44#define glTexGenx glTexGenxOES
45#define glTexGenxv glTexGenxvOES
46
47
48
Mathias Agopian8331f722009-05-08 15:35:17 -070049/* special calls implemented in Android's GLES wrapper used to more
50 * efficiently bound-check passed arrays */
51extern "C" {
52GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
53 const GLvoid *ptr, GLsizei count);
54GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
55 const GLvoid *pointer, GLsizei count);
56GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
57 GLsizei stride, const GLvoid *pointer, GLsizei count);
58GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
59 GLsizei stride, const GLvoid *pointer, GLsizei count);
Jack Palevichbe6eac82009-12-08 15:43:51 +080060GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
61 GLsizei stride, const GLvoid *pointer, GLsizei count);
62GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
63 GLsizei stride, const GLvoid *pointer, GLsizei count);
64GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
65 GLsizei stride, const GLvoid *pointer, GLsizei count);
Mathias Agopian8331f722009-05-08 15:35:17 -070066}
67
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080068static int initialized = 0;
69
70static jclass nioAccessClass;
71static jclass bufferClass;
Jack Palevich91a27ae2009-06-15 21:03:24 -070072static jclass G11ImplClass;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080073static jmethodID getBasePointerID;
74static jmethodID getBaseArrayID;
75static jmethodID getBaseArrayOffsetID;
Jack Palevich91a27ae2009-06-15 21:03:24 -070076static jmethodID allowIndirectBuffersID;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080077static jfieldID positionID;
78static jfieldID limitID;
79static jfieldID elementSizeShiftID;
Jack Palevich8a4de4b2010-01-28 20:28:32 +080080static jfieldID haveCheckedExtensionsID;
81static jfieldID have_OES_blend_equation_separateID;
82static jfieldID have_OES_blend_subtractID;
83static jfieldID have_OES_framebuffer_objectID;
84static jfieldID have_OES_texture_cube_mapID;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080085
86/* Cache method IDs each time the class is loaded. */
87
Jack Palevich27f80022009-04-15 19:13:17 -070088static void
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070089nativeClassInit(JNIEnv *_env, jclass glImplClass)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080090{
91 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
92 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
93
94 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
95 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
96
Jack Palevich91a27ae2009-06-15 21:03:24 -070097 jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl");
98 G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal);
Jack Palevich8a4de4b2010-01-28 20:28:32 +080099 haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z");
100 have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z");
101 have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z");
102 have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z");
103 have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z");
Jack Palevich91a27ae2009-06-15 21:03:24 -0700104
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800105 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
106 "getBasePointer", "(Ljava/nio/Buffer;)J");
107 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
108 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
109 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
110 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
Jack Palevich91a27ae2009-06-15 21:03:24 -0700111 allowIndirectBuffersID = _env->GetStaticMethodID(g11impClassLocal,
112 "allowIndirectBuffers", "(Ljava/lang/String;)Z");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800113 positionID = _env->GetFieldID(bufferClass, "position", "I");
114 limitID = _env->GetFieldID(bufferClass, "limit", "I");
115 elementSizeShiftID =
116 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
117}
118
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800119static void *
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700120getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800121{
122 jint position;
123 jint limit;
124 jint elementSizeShift;
125 jlong pointer;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800126
127 position = _env->GetIntField(buffer, positionID);
128 limit = _env->GetIntField(buffer, limitID);
129 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
130 *remaining = (limit - position) << elementSizeShift;
131 pointer = _env->CallStaticLongMethod(nioAccessClass,
132 getBasePointerID, buffer);
133 if (pointer != 0L) {
George Burgess IV974403a2017-01-24 15:59:19 -0800134 *offset = 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800135 *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) {
George Burgess IV974403a2017-01-24 15:59:19 -0800142 *offset = 0;
Jack Palevich91a27ae2009-06-15 21:03:24 -0700143 return (void*) NULL;
144 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700145 *offset = _env->CallStaticIntMethod(nioAccessClass,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800146 getBaseArrayOffsetID, buffer);
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700147
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700148 return NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800149}
150
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800151static void
152releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
153{
154 _env->ReleasePrimitiveArrayCritical(array, data,
155 commit ? 0 : JNI_ABORT);
156}
157
Jack Palevich91a27ae2009-06-15 21:03:24 -0700158extern "C" {
159extern char* __progname;
160}
161
162static bool
163allowIndirectBuffers(JNIEnv *_env) {
164 static jint sIndirectBufferCompatability;
165 if (sIndirectBufferCompatability == 0) {
166 jobject appName = _env->NewStringUTF(::__progname);
167 sIndirectBufferCompatability = _env->CallStaticBooleanMethod(G11ImplClass, allowIndirectBuffersID, appName) ? 2 : 1;
168 }
169 return sIndirectBufferCompatability == 2;
170}
171
Jack Palevich16e79722009-05-15 18:13:34 -0700172static void *
173getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
Jack Palevich91a27ae2009-06-15 21:03:24 -0700174 if (!buffer) {
175 return NULL;
176 }
177 void* buf = _env->GetDirectBufferAddress(buffer);
Jack Palevich16e79722009-05-15 18:13:34 -0700178 if (buf) {
179 jint position = _env->GetIntField(buffer, positionID);
180 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
Jack Palevich91a27ae2009-06-15 21:03:24 -0700181 buf = ((char*) buf) + (position << elementSizeShift);
Jack Palevich16e79722009-05-15 18:13:34 -0700182 } else {
Jack Palevich91a27ae2009-06-15 21:03:24 -0700183 if (allowIndirectBuffers(_env)) {
184 jarray array = 0;
185 jint remaining;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700186 jint offset;
187 buf = getPointer(_env, buffer, &array, &remaining, &offset);
Jack Palevich91a27ae2009-06-15 21:03:24 -0700188 if (array) {
189 releasePointer(_env, array, buf, 0);
190 }
synergydev01994c72013-10-14 12:20:16 -0700191 buf = (char*)buf + offset;
Jack Palevich91a27ae2009-06-15 21:03:24 -0700192 } else {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700193 jniThrowException(_env, "java/lang/IllegalArgumentException",
194 "Must use a native order direct Buffer");
Jack Palevich91a27ae2009-06-15 21:03:24 -0700195 }
Jack Palevich16e79722009-05-15 18:13:34 -0700196 }
Jack Palevich91a27ae2009-06-15 21:03:24 -0700197 return buf;
Jack Palevich16e79722009-05-15 18:13:34 -0700198}
199
Jack Palevichbe509c92009-05-07 09:52:14 -0700200static int
201getNumCompressedTextureFormats() {
202 int numCompressedTextureFormats = 0;
203 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
204 return numCompressedTextureFormats;
205}
206
Jack Palevich8a4de4b2010-01-28 20:28:32 +0800207// Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is
208// terminated by either 0 or space, while pExtension is terminated by 0.
209
210static bool
211extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) {
212 while (true) {
213 char a = *pExtensions++;
214 char b = *pExtension++;
215 bool aEnd = a == '\0' || a == ' ';
216 bool bEnd = b == '\0';
217 if ( aEnd || bEnd) {
218 return aEnd == bEnd;
219 }
220 if ( a != b ) {
221 return false;
222 }
223 }
224}
225
226static const GLubyte*
227nextExtension(const GLubyte* pExtensions) {
228 while (true) {
229 char a = *pExtensions++;
230 if ( a == '\0') {
231 return pExtensions-1;
232 } else if ( a == ' ') {
233 return pExtensions;
234 }
235 }
236}
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700237
Jack Palevich8a4de4b2010-01-28 20:28:32 +0800238static bool
239checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) {
240 for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) {
241 if (extensionEqual(pExtensions, pExtension)) {
242 return true;
243 }
244 }
245 return false;
246}
247
248static bool
249supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) {
250 if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) {
251 _env->SetBooleanField(impl, haveCheckedExtensionsID, true);
252 const GLubyte* sExtensions = glGetString(GL_EXTENSIONS);
253 _env->SetBooleanField(impl, have_OES_blend_equation_separateID,
254 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate"));
255 _env->SetBooleanField(impl, have_OES_blend_subtractID,
256 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract"));
257 _env->SetBooleanField(impl, have_OES_framebuffer_objectID,
258 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object"));
259 _env->SetBooleanField(impl, have_OES_texture_cube_mapID,
260 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map"));
261 }
262 return _env->GetBooleanField(impl, fieldId);
263}
264
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800265// --------------------------------------------------------------------------
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800266/* void glActiveTexture ( GLenum texture ) */
267static void
268android_glActiveTexture__I
269 (JNIEnv *_env, jobject _this, jint texture) {
270 glActiveTexture(
271 (GLenum)texture
272 );
273}
274
275/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
276static void
277android_glAlphaFunc__IF
278 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
279 glAlphaFunc(
280 (GLenum)func,
281 (GLclampf)ref
282 );
283}
284
285/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
286static void
287android_glAlphaFuncx__II
288 (JNIEnv *_env, jobject _this, jint func, jint ref) {
289 glAlphaFuncx(
290 (GLenum)func,
291 (GLclampx)ref
292 );
293}
294
295/* void glBindTexture ( GLenum target, GLuint texture ) */
296static void
297android_glBindTexture__II
298 (JNIEnv *_env, jobject _this, jint target, jint texture) {
299 glBindTexture(
300 (GLenum)target,
301 (GLuint)texture
302 );
303}
304
305/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
306static void
307android_glBlendFunc__II
308 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
309 glBlendFunc(
310 (GLenum)sfactor,
311 (GLenum)dfactor
312 );
313}
314
315/* void glClear ( GLbitfield mask ) */
316static void
317android_glClear__I
318 (JNIEnv *_env, jobject _this, jint mask) {
319 glClear(
320 (GLbitfield)mask
321 );
322}
323
324/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
325static void
326android_glClearColor__FFFF
327 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
328 glClearColor(
329 (GLclampf)red,
330 (GLclampf)green,
331 (GLclampf)blue,
332 (GLclampf)alpha
333 );
334}
335
336/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
337static void
338android_glClearColorx__IIII
339 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
340 glClearColorx(
341 (GLclampx)red,
342 (GLclampx)green,
343 (GLclampx)blue,
344 (GLclampx)alpha
345 );
346}
347
348/* void glClearDepthf ( GLclampf depth ) */
349static void
350android_glClearDepthf__F
351 (JNIEnv *_env, jobject _this, jfloat depth) {
352 glClearDepthf(
353 (GLclampf)depth
354 );
355}
356
357/* void glClearDepthx ( GLclampx depth ) */
358static void
359android_glClearDepthx__I
360 (JNIEnv *_env, jobject _this, jint depth) {
361 glClearDepthx(
362 (GLclampx)depth
363 );
364}
365
366/* void glClearStencil ( GLint s ) */
367static void
368android_glClearStencil__I
369 (JNIEnv *_env, jobject _this, jint s) {
370 glClearStencil(
371 (GLint)s
372 );
373}
374
375/* void glClientActiveTexture ( GLenum texture ) */
376static void
377android_glClientActiveTexture__I
378 (JNIEnv *_env, jobject _this, jint texture) {
379 glClientActiveTexture(
380 (GLenum)texture
381 );
382}
383
384/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
385static void
386android_glColor4f__FFFF
387 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
388 glColor4f(
389 (GLfloat)red,
390 (GLfloat)green,
391 (GLfloat)blue,
392 (GLfloat)alpha
393 );
394}
395
396/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
397static void
398android_glColor4x__IIII
399 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
400 glColor4x(
401 (GLfixed)red,
402 (GLfixed)green,
403 (GLfixed)blue,
404 (GLfixed)alpha
405 );
406}
407
408/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
409static void
410android_glColorMask__ZZZZ
411 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
412 glColorMask(
413 (GLboolean)red,
414 (GLboolean)green,
415 (GLboolean)blue,
416 (GLboolean)alpha
417 );
418}
419
420/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
421static void
422android_glColorPointerBounds__IIILjava_nio_Buffer_2I
423 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -0800424 jint _exception = 0;
425 const char * _exceptionType = NULL;
426 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800427 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700428 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800429 jint _remaining;
430 GLvoid *pointer = (GLvoid *) 0;
431
Jack Paleviche20ea782009-05-07 18:28:29 -0700432 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -0700433 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -0700434 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -0700435 return;
436 }
437 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800438 glColorPointerBounds(
439 (GLint)size,
440 (GLenum)type,
441 (GLsizei)stride,
442 (GLvoid *)pointer,
443 (GLsizei)remaining
444 );
Romain Guy84cac202016-12-05 12:26:02 -0800445 if (_exception) {
446 jniThrowException(_env, _exceptionType, _exceptionMessage);
447 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800448}
449
450/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
451static void
452android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
453 (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 -0800454 jint _exception = 0;
455 const char * _exceptionType = NULL;
456 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800457 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700458 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800459 jint _remaining;
460 GLvoid *data = (GLvoid *) 0;
461
Romain Guy84cac202016-12-05 12:26:02 -0800462 if (!data_buf) {
463 _exception = 1;
464 _exceptionType = "java/lang/IllegalArgumentException";
465 _exceptionMessage = "data == null";
466 goto exit;
467 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700468 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700469 if (data == NULL) {
470 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
471 data = (GLvoid *) (_dataBase + _bufferOffset);
472 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800473 glCompressedTexImage2D(
474 (GLenum)target,
475 (GLint)level,
476 (GLenum)internalformat,
477 (GLsizei)width,
478 (GLsizei)height,
479 (GLint)border,
480 (GLsizei)imageSize,
481 (GLvoid *)data
482 );
Romain Guy84cac202016-12-05 12:26:02 -0800483
484exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800485 if (_array) {
486 releasePointer(_env, _array, data, JNI_FALSE);
487 }
Romain Guy84cac202016-12-05 12:26:02 -0800488 if (_exception) {
489 jniThrowException(_env, _exceptionType, _exceptionMessage);
490 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800491}
492
493/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
494static void
495android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
496 (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 -0800497 jint _exception = 0;
498 const char * _exceptionType = NULL;
499 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800500 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700501 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800502 jint _remaining;
503 GLvoid *data = (GLvoid *) 0;
504
Romain Guy84cac202016-12-05 12:26:02 -0800505 if (!data_buf) {
506 _exception = 1;
507 _exceptionType = "java/lang/IllegalArgumentException";
508 _exceptionMessage = "data == null";
509 goto exit;
510 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700511 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700512 if (data == NULL) {
513 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
514 data = (GLvoid *) (_dataBase + _bufferOffset);
515 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800516 glCompressedTexSubImage2D(
517 (GLenum)target,
518 (GLint)level,
519 (GLint)xoffset,
520 (GLint)yoffset,
521 (GLsizei)width,
522 (GLsizei)height,
523 (GLenum)format,
524 (GLsizei)imageSize,
525 (GLvoid *)data
526 );
Romain Guy84cac202016-12-05 12:26:02 -0800527
528exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800529 if (_array) {
530 releasePointer(_env, _array, data, JNI_FALSE);
531 }
Romain Guy84cac202016-12-05 12:26:02 -0800532 if (_exception) {
533 jniThrowException(_env, _exceptionType, _exceptionMessage);
534 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800535}
536
537/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
538static void
539android_glCopyTexImage2D__IIIIIIII
540 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
541 glCopyTexImage2D(
542 (GLenum)target,
543 (GLint)level,
544 (GLenum)internalformat,
545 (GLint)x,
546 (GLint)y,
547 (GLsizei)width,
548 (GLsizei)height,
549 (GLint)border
550 );
551}
552
553/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
554static void
555android_glCopyTexSubImage2D__IIIIIIII
556 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
557 glCopyTexSubImage2D(
558 (GLenum)target,
559 (GLint)level,
560 (GLint)xoffset,
561 (GLint)yoffset,
562 (GLint)x,
563 (GLint)y,
564 (GLsizei)width,
565 (GLsizei)height
566 );
567}
568
569/* void glCullFace ( GLenum mode ) */
570static void
571android_glCullFace__I
572 (JNIEnv *_env, jobject _this, jint mode) {
573 glCullFace(
574 (GLenum)mode
575 );
576}
577
578/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
579static void
580android_glDeleteTextures__I_3II
581 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700582 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800583 const char * _exceptionType = NULL;
584 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800585 GLuint *textures_base = (GLuint *) 0;
586 jint _remaining;
587 GLuint *textures = (GLuint *) 0;
588
589 if (!textures_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700590 _exception = 1;
591 _exceptionType = "java/lang/IllegalArgumentException";
592 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800593 goto exit;
594 }
595 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700596 _exception = 1;
597 _exceptionType = "java/lang/IllegalArgumentException";
598 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800599 goto exit;
600 }
601 _remaining = _env->GetArrayLength(textures_ref) - offset;
602 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700603 _exception = 1;
604 _exceptionType = "java/lang/IllegalArgumentException";
605 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800606 goto exit;
607 }
608 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700609 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800610 textures = textures_base + offset;
611
612 glDeleteTextures(
613 (GLsizei)n,
614 (GLuint *)textures
615 );
616
617exit:
618 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700619 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800620 JNI_ABORT);
621 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700622 if (_exception) {
623 jniThrowException(_env, _exceptionType, _exceptionMessage);
624 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800625}
626
627/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
628static void
629android_glDeleteTextures__ILjava_nio_IntBuffer_2
630 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700631 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800632 const char * _exceptionType = NULL;
633 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700634 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700635 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800636 jint _remaining;
637 GLuint *textures = (GLuint *) 0;
638
Romain Guy84cac202016-12-05 12:26:02 -0800639 if (!textures_buf) {
640 _exception = 1;
641 _exceptionType = "java/lang/IllegalArgumentException";
642 _exceptionMessage = "textures == null";
643 goto exit;
644 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700645 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800646 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700647 _exception = 1;
648 _exceptionType = "java/lang/IllegalArgumentException";
649 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800650 goto exit;
651 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700652 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700653 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700654 textures = (GLuint *) (_texturesBase + _bufferOffset);
655 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800656 glDeleteTextures(
657 (GLsizei)n,
658 (GLuint *)textures
659 );
660
661exit:
662 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700663 _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800664 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700665 if (_exception) {
666 jniThrowException(_env, _exceptionType, _exceptionMessage);
667 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800668}
669
670/* void glDepthFunc ( GLenum func ) */
671static void
672android_glDepthFunc__I
673 (JNIEnv *_env, jobject _this, jint func) {
674 glDepthFunc(
675 (GLenum)func
676 );
677}
678
679/* void glDepthMask ( GLboolean flag ) */
680static void
681android_glDepthMask__Z
682 (JNIEnv *_env, jobject _this, jboolean flag) {
683 glDepthMask(
684 (GLboolean)flag
685 );
686}
687
688/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
689static void
690android_glDepthRangef__FF
691 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
692 glDepthRangef(
693 (GLclampf)zNear,
694 (GLclampf)zFar
695 );
696}
697
698/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
699static void
700android_glDepthRangex__II
701 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
702 glDepthRangex(
703 (GLclampx)zNear,
704 (GLclampx)zFar
705 );
706}
707
708/* void glDisable ( GLenum cap ) */
709static void
710android_glDisable__I
711 (JNIEnv *_env, jobject _this, jint cap) {
712 glDisable(
713 (GLenum)cap
714 );
715}
716
717/* void glDisableClientState ( GLenum array ) */
718static void
719android_glDisableClientState__I
720 (JNIEnv *_env, jobject _this, jint array) {
721 glDisableClientState(
722 (GLenum)array
723 );
724}
725
726/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
727static void
728android_glDrawArrays__III
729 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
730 glDrawArrays(
731 (GLenum)mode,
732 (GLint)first,
733 (GLsizei)count
734 );
735}
736
737/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
738static void
739android_glDrawElements__IIILjava_nio_Buffer_2
740 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700741 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800742 const char * _exceptionType = NULL;
743 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800744 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700745 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800746 jint _remaining;
747 GLvoid *indices = (GLvoid *) 0;
748
Romain Guy84cac202016-12-05 12:26:02 -0800749 if (!indices_buf) {
750 _exception = 1;
751 _exceptionType = "java/lang/IllegalArgumentException";
752 _exceptionMessage = "indices == null";
753 goto exit;
754 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700755 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800756 if (_remaining < count) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700757 _exception = 1;
758 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
759 _exceptionMessage = "remaining() < count < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800760 goto exit;
761 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700762 if (indices == NULL) {
763 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
764 indices = (GLvoid *) (_indicesBase + _bufferOffset);
765 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800766 glDrawElements(
767 (GLenum)mode,
768 (GLsizei)count,
769 (GLenum)type,
770 (GLvoid *)indices
771 );
772
773exit:
774 if (_array) {
775 releasePointer(_env, _array, indices, JNI_FALSE);
776 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700777 if (_exception) {
778 jniThrowException(_env, _exceptionType, _exceptionMessage);
779 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800780}
781
782/* void glEnable ( GLenum cap ) */
783static void
784android_glEnable__I
785 (JNIEnv *_env, jobject _this, jint cap) {
786 glEnable(
787 (GLenum)cap
788 );
789}
790
791/* void glEnableClientState ( GLenum array ) */
792static void
793android_glEnableClientState__I
794 (JNIEnv *_env, jobject _this, jint array) {
795 glEnableClientState(
796 (GLenum)array
797 );
798}
799
800/* void glFinish ( void ) */
801static void
802android_glFinish__
803 (JNIEnv *_env, jobject _this) {
804 glFinish();
805}
806
807/* void glFlush ( void ) */
808static void
809android_glFlush__
810 (JNIEnv *_env, jobject _this) {
811 glFlush();
812}
813
814/* void glFogf ( GLenum pname, GLfloat param ) */
815static void
816android_glFogf__IF
817 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
818 glFogf(
819 (GLenum)pname,
820 (GLfloat)param
821 );
822}
823
824/* void glFogfv ( GLenum pname, const GLfloat *params ) */
825static void
826android_glFogfv__I_3FI
827 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700828 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800829 const char * _exceptionType = NULL;
830 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800831 GLfloat *params_base = (GLfloat *) 0;
832 jint _remaining;
833 GLfloat *params = (GLfloat *) 0;
834
835 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700836 _exception = 1;
837 _exceptionType = "java/lang/IllegalArgumentException";
838 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800839 goto exit;
840 }
841 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700842 _exception = 1;
843 _exceptionType = "java/lang/IllegalArgumentException";
844 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800845 goto exit;
846 }
847 _remaining = _env->GetArrayLength(params_ref) - offset;
848 int _needed;
849 switch (pname) {
850#if defined(GL_FOG_MODE)
851 case GL_FOG_MODE:
852#endif // defined(GL_FOG_MODE)
853#if defined(GL_FOG_DENSITY)
854 case GL_FOG_DENSITY:
855#endif // defined(GL_FOG_DENSITY)
856#if defined(GL_FOG_START)
857 case GL_FOG_START:
858#endif // defined(GL_FOG_START)
859#if defined(GL_FOG_END)
860 case GL_FOG_END:
861#endif // defined(GL_FOG_END)
862 _needed = 1;
863 break;
864#if defined(GL_FOG_COLOR)
865 case GL_FOG_COLOR:
866#endif // defined(GL_FOG_COLOR)
867 _needed = 4;
868 break;
869 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800870 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800871 break;
872 }
873 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700874 _exception = 1;
875 _exceptionType = "java/lang/IllegalArgumentException";
876 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800877 goto exit;
878 }
879 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700880 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800881 params = params_base + offset;
882
883 glFogfv(
884 (GLenum)pname,
885 (GLfloat *)params
886 );
887
888exit:
889 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700890 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800891 JNI_ABORT);
892 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700893 if (_exception) {
894 jniThrowException(_env, _exceptionType, _exceptionMessage);
895 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800896}
897
898/* void glFogfv ( GLenum pname, const GLfloat *params ) */
899static void
900android_glFogfv__ILjava_nio_FloatBuffer_2
901 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700902 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800903 const char * _exceptionType = NULL;
904 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700905 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700906 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800907 jint _remaining;
908 GLfloat *params = (GLfloat *) 0;
909
Romain Guy84cac202016-12-05 12:26:02 -0800910 if (!params_buf) {
911 _exception = 1;
912 _exceptionType = "java/lang/IllegalArgumentException";
913 _exceptionMessage = "params == null";
914 goto exit;
915 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700916 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800917 int _needed;
918 switch (pname) {
919#if defined(GL_FOG_MODE)
920 case GL_FOG_MODE:
921#endif // defined(GL_FOG_MODE)
922#if defined(GL_FOG_DENSITY)
923 case GL_FOG_DENSITY:
924#endif // defined(GL_FOG_DENSITY)
925#if defined(GL_FOG_START)
926 case GL_FOG_START:
927#endif // defined(GL_FOG_START)
928#if defined(GL_FOG_END)
929 case GL_FOG_END:
930#endif // defined(GL_FOG_END)
931 _needed = 1;
932 break;
933#if defined(GL_FOG_COLOR)
934 case GL_FOG_COLOR:
935#endif // defined(GL_FOG_COLOR)
936 _needed = 4;
937 break;
938 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800939 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800940 break;
941 }
942 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700943 _exception = 1;
944 _exceptionType = "java/lang/IllegalArgumentException";
945 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800946 goto exit;
947 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700948 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700949 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700950 params = (GLfloat *) (_paramsBase + _bufferOffset);
951 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800952 glFogfv(
953 (GLenum)pname,
954 (GLfloat *)params
955 );
956
957exit:
958 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700959 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800960 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700961 if (_exception) {
962 jniThrowException(_env, _exceptionType, _exceptionMessage);
963 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800964}
965
966/* void glFogx ( GLenum pname, GLfixed param ) */
967static void
968android_glFogx__II
969 (JNIEnv *_env, jobject _this, jint pname, jint param) {
970 glFogx(
971 (GLenum)pname,
972 (GLfixed)param
973 );
974}
975
976/* void glFogxv ( GLenum pname, const GLfixed *params ) */
977static void
978android_glFogxv__I_3II
979 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700980 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800981 const char * _exceptionType = NULL;
982 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800983 GLfixed *params_base = (GLfixed *) 0;
984 jint _remaining;
985 GLfixed *params = (GLfixed *) 0;
986
987 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700988 _exception = 1;
989 _exceptionType = "java/lang/IllegalArgumentException";
990 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800991 goto exit;
992 }
993 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700994 _exception = 1;
995 _exceptionType = "java/lang/IllegalArgumentException";
996 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800997 goto exit;
998 }
999 _remaining = _env->GetArrayLength(params_ref) - offset;
1000 int _needed;
1001 switch (pname) {
1002#if defined(GL_FOG_MODE)
1003 case GL_FOG_MODE:
1004#endif // defined(GL_FOG_MODE)
1005#if defined(GL_FOG_DENSITY)
1006 case GL_FOG_DENSITY:
1007#endif // defined(GL_FOG_DENSITY)
1008#if defined(GL_FOG_START)
1009 case GL_FOG_START:
1010#endif // defined(GL_FOG_START)
1011#if defined(GL_FOG_END)
1012 case GL_FOG_END:
1013#endif // defined(GL_FOG_END)
1014 _needed = 1;
1015 break;
1016#if defined(GL_FOG_COLOR)
1017 case GL_FOG_COLOR:
1018#endif // defined(GL_FOG_COLOR)
1019 _needed = 4;
1020 break;
1021 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001022 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001023 break;
1024 }
1025 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001026 _exception = 1;
1027 _exceptionType = "java/lang/IllegalArgumentException";
1028 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001029 goto exit;
1030 }
1031 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001032 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001033 params = params_base + offset;
1034
1035 glFogxv(
1036 (GLenum)pname,
1037 (GLfixed *)params
1038 );
1039
1040exit:
1041 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001042 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001043 JNI_ABORT);
1044 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001045 if (_exception) {
1046 jniThrowException(_env, _exceptionType, _exceptionMessage);
1047 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001048}
1049
1050/* void glFogxv ( GLenum pname, const GLfixed *params ) */
1051static void
1052android_glFogxv__ILjava_nio_IntBuffer_2
1053 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001054 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001055 const char * _exceptionType = NULL;
1056 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001057 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001058 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001059 jint _remaining;
1060 GLfixed *params = (GLfixed *) 0;
1061
Romain Guy84cac202016-12-05 12:26:02 -08001062 if (!params_buf) {
1063 _exception = 1;
1064 _exceptionType = "java/lang/IllegalArgumentException";
1065 _exceptionMessage = "params == null";
1066 goto exit;
1067 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001068 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001069 int _needed;
1070 switch (pname) {
1071#if defined(GL_FOG_MODE)
1072 case GL_FOG_MODE:
1073#endif // defined(GL_FOG_MODE)
1074#if defined(GL_FOG_DENSITY)
1075 case GL_FOG_DENSITY:
1076#endif // defined(GL_FOG_DENSITY)
1077#if defined(GL_FOG_START)
1078 case GL_FOG_START:
1079#endif // defined(GL_FOG_START)
1080#if defined(GL_FOG_END)
1081 case GL_FOG_END:
1082#endif // defined(GL_FOG_END)
1083 _needed = 1;
1084 break;
1085#if defined(GL_FOG_COLOR)
1086 case GL_FOG_COLOR:
1087#endif // defined(GL_FOG_COLOR)
1088 _needed = 4;
1089 break;
1090 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001091 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001092 break;
1093 }
1094 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001095 _exception = 1;
1096 _exceptionType = "java/lang/IllegalArgumentException";
1097 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001098 goto exit;
1099 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001100 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001101 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001102 params = (GLfixed *) (_paramsBase + _bufferOffset);
1103 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001104 glFogxv(
1105 (GLenum)pname,
1106 (GLfixed *)params
1107 );
1108
1109exit:
1110 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001111 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001112 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001113 if (_exception) {
1114 jniThrowException(_env, _exceptionType, _exceptionMessage);
1115 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001116}
1117
1118/* void glFrontFace ( GLenum mode ) */
1119static void
1120android_glFrontFace__I
1121 (JNIEnv *_env, jobject _this, jint mode) {
1122 glFrontFace(
1123 (GLenum)mode
1124 );
1125}
1126
1127/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1128static void
1129android_glFrustumf__FFFFFF
1130 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1131 glFrustumf(
1132 (GLfloat)left,
1133 (GLfloat)right,
1134 (GLfloat)bottom,
1135 (GLfloat)top,
1136 (GLfloat)zNear,
1137 (GLfloat)zFar
1138 );
1139}
1140
1141/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1142static void
1143android_glFrustumx__IIIIII
1144 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1145 glFrustumx(
1146 (GLfixed)left,
1147 (GLfixed)right,
1148 (GLfixed)bottom,
1149 (GLfixed)top,
1150 (GLfixed)zNear,
1151 (GLfixed)zFar
1152 );
1153}
1154
1155/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1156static void
1157android_glGenTextures__I_3II
1158 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1159 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001160 const char * _exceptionType = NULL;
1161 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001162 GLuint *textures_base = (GLuint *) 0;
1163 jint _remaining;
1164 GLuint *textures = (GLuint *) 0;
1165
1166 if (!textures_ref) {
1167 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001168 _exceptionType = "java/lang/IllegalArgumentException";
1169 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001170 goto exit;
1171 }
1172 if (offset < 0) {
1173 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001174 _exceptionType = "java/lang/IllegalArgumentException";
1175 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001176 goto exit;
1177 }
1178 _remaining = _env->GetArrayLength(textures_ref) - offset;
1179 if (_remaining < n) {
1180 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001181 _exceptionType = "java/lang/IllegalArgumentException";
1182 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001183 goto exit;
1184 }
1185 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001186 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001187 textures = textures_base + offset;
1188
1189 glGenTextures(
1190 (GLsizei)n,
1191 (GLuint *)textures
1192 );
1193
1194exit:
1195 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001196 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001197 _exception ? JNI_ABORT: 0);
1198 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001199 if (_exception) {
1200 jniThrowException(_env, _exceptionType, _exceptionMessage);
1201 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001202}
1203
1204/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1205static void
1206android_glGenTextures__ILjava_nio_IntBuffer_2
1207 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1208 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001209 const char * _exceptionType = NULL;
1210 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001211 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001212 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001213 jint _remaining;
1214 GLuint *textures = (GLuint *) 0;
1215
Romain Guy84cac202016-12-05 12:26:02 -08001216 if (!textures_buf) {
1217 _exception = 1;
1218 _exceptionType = "java/lang/IllegalArgumentException";
1219 _exceptionMessage = "textures == null";
1220 goto exit;
1221 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001222 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001223 if (_remaining < n) {
1224 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001225 _exceptionType = "java/lang/IllegalArgumentException";
1226 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001227 goto exit;
1228 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001229 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001230 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001231 textures = (GLuint *) (_texturesBase + _bufferOffset);
1232 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001233 glGenTextures(
1234 (GLsizei)n,
1235 (GLuint *)textures
1236 );
1237
1238exit:
1239 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001240 _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001241 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001242 if (_exception) {
1243 jniThrowException(_env, _exceptionType, _exceptionMessage);
1244 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001245}
1246
1247/* GLenum glGetError ( void ) */
1248static jint
1249android_glGetError__
1250 (JNIEnv *_env, jobject _this) {
1251 GLenum _returnValue;
1252 _returnValue = glGetError();
Elliott Hughes428d3fc2013-09-24 17:15:41 -07001253 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001254}
1255
1256/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1257static void
1258android_glGetIntegerv__I_3II
1259 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1260 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001261 const char * _exceptionType = NULL;
1262 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001263 GLint *params_base = (GLint *) 0;
1264 jint _remaining;
1265 GLint *params = (GLint *) 0;
1266
1267 if (!params_ref) {
1268 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001269 _exceptionType = "java/lang/IllegalArgumentException";
1270 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001271 goto exit;
1272 }
1273 if (offset < 0) {
1274 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001275 _exceptionType = "java/lang/IllegalArgumentException";
1276 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001277 goto exit;
1278 }
1279 _remaining = _env->GetArrayLength(params_ref) - offset;
1280 int _needed;
1281 switch (pname) {
1282#if defined(GL_ALPHA_BITS)
1283 case GL_ALPHA_BITS:
1284#endif // defined(GL_ALPHA_BITS)
1285#if defined(GL_ALPHA_TEST_FUNC)
1286 case GL_ALPHA_TEST_FUNC:
1287#endif // defined(GL_ALPHA_TEST_FUNC)
1288#if defined(GL_ALPHA_TEST_REF)
1289 case GL_ALPHA_TEST_REF:
1290#endif // defined(GL_ALPHA_TEST_REF)
1291#if defined(GL_BLEND_DST)
1292 case GL_BLEND_DST:
1293#endif // defined(GL_BLEND_DST)
1294#if defined(GL_BLUE_BITS)
1295 case GL_BLUE_BITS:
1296#endif // defined(GL_BLUE_BITS)
1297#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1298 case GL_COLOR_ARRAY_BUFFER_BINDING:
1299#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1300#if defined(GL_COLOR_ARRAY_SIZE)
1301 case GL_COLOR_ARRAY_SIZE:
1302#endif // defined(GL_COLOR_ARRAY_SIZE)
1303#if defined(GL_COLOR_ARRAY_STRIDE)
1304 case GL_COLOR_ARRAY_STRIDE:
1305#endif // defined(GL_COLOR_ARRAY_STRIDE)
1306#if defined(GL_COLOR_ARRAY_TYPE)
1307 case GL_COLOR_ARRAY_TYPE:
1308#endif // defined(GL_COLOR_ARRAY_TYPE)
1309#if defined(GL_CULL_FACE)
1310 case GL_CULL_FACE:
1311#endif // defined(GL_CULL_FACE)
1312#if defined(GL_DEPTH_BITS)
1313 case GL_DEPTH_BITS:
1314#endif // defined(GL_DEPTH_BITS)
1315#if defined(GL_DEPTH_CLEAR_VALUE)
1316 case GL_DEPTH_CLEAR_VALUE:
1317#endif // defined(GL_DEPTH_CLEAR_VALUE)
1318#if defined(GL_DEPTH_FUNC)
1319 case GL_DEPTH_FUNC:
1320#endif // defined(GL_DEPTH_FUNC)
1321#if defined(GL_DEPTH_WRITEMASK)
1322 case GL_DEPTH_WRITEMASK:
1323#endif // defined(GL_DEPTH_WRITEMASK)
1324#if defined(GL_FOG_DENSITY)
1325 case GL_FOG_DENSITY:
1326#endif // defined(GL_FOG_DENSITY)
1327#if defined(GL_FOG_END)
1328 case GL_FOG_END:
1329#endif // defined(GL_FOG_END)
1330#if defined(GL_FOG_MODE)
1331 case GL_FOG_MODE:
1332#endif // defined(GL_FOG_MODE)
1333#if defined(GL_FOG_START)
1334 case GL_FOG_START:
1335#endif // defined(GL_FOG_START)
1336#if defined(GL_FRONT_FACE)
1337 case GL_FRONT_FACE:
1338#endif // defined(GL_FRONT_FACE)
1339#if defined(GL_GREEN_BITS)
1340 case GL_GREEN_BITS:
1341#endif // defined(GL_GREEN_BITS)
1342#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1343 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1344#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1345#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1346 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1347#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001348#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1349 case GL_LIGHT_MODEL_COLOR_CONTROL:
1350#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1351#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1352 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1353#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001354#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1355 case GL_LIGHT_MODEL_TWO_SIDE:
1356#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1357#if defined(GL_LINE_SMOOTH_HINT)
1358 case GL_LINE_SMOOTH_HINT:
1359#endif // defined(GL_LINE_SMOOTH_HINT)
1360#if defined(GL_LINE_WIDTH)
1361 case GL_LINE_WIDTH:
1362#endif // defined(GL_LINE_WIDTH)
1363#if defined(GL_LOGIC_OP_MODE)
1364 case GL_LOGIC_OP_MODE:
1365#endif // defined(GL_LOGIC_OP_MODE)
1366#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1367 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1368#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1369#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1370 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1371#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1372#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1373 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1374#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1375#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1376 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1377#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1378#if defined(GL_MATRIX_MODE)
1379 case GL_MATRIX_MODE:
1380#endif // defined(GL_MATRIX_MODE)
1381#if defined(GL_MAX_CLIP_PLANES)
1382 case GL_MAX_CLIP_PLANES:
1383#endif // defined(GL_MAX_CLIP_PLANES)
1384#if defined(GL_MAX_ELEMENTS_INDICES)
1385 case GL_MAX_ELEMENTS_INDICES:
1386#endif // defined(GL_MAX_ELEMENTS_INDICES)
1387#if defined(GL_MAX_ELEMENTS_VERTICES)
1388 case GL_MAX_ELEMENTS_VERTICES:
1389#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1390#if defined(GL_MAX_LIGHTS)
1391 case GL_MAX_LIGHTS:
1392#endif // defined(GL_MAX_LIGHTS)
1393#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1394 case GL_MAX_MODELVIEW_STACK_DEPTH:
1395#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1396#if defined(GL_MAX_PALETTE_MATRICES_OES)
1397 case GL_MAX_PALETTE_MATRICES_OES:
1398#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1399#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1400 case GL_MAX_PROJECTION_STACK_DEPTH:
1401#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1402#if defined(GL_MAX_TEXTURE_SIZE)
1403 case GL_MAX_TEXTURE_SIZE:
1404#endif // defined(GL_MAX_TEXTURE_SIZE)
1405#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1406 case GL_MAX_TEXTURE_STACK_DEPTH:
1407#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1408#if defined(GL_MAX_TEXTURE_UNITS)
1409 case GL_MAX_TEXTURE_UNITS:
1410#endif // defined(GL_MAX_TEXTURE_UNITS)
1411#if defined(GL_MAX_VERTEX_UNITS_OES)
1412 case GL_MAX_VERTEX_UNITS_OES:
1413#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1414#if defined(GL_MODELVIEW_STACK_DEPTH)
1415 case GL_MODELVIEW_STACK_DEPTH:
1416#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1417#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1418 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1419#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1420#if defined(GL_NORMAL_ARRAY_STRIDE)
1421 case GL_NORMAL_ARRAY_STRIDE:
1422#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1423#if defined(GL_NORMAL_ARRAY_TYPE)
1424 case GL_NORMAL_ARRAY_TYPE:
1425#endif // defined(GL_NORMAL_ARRAY_TYPE)
1426#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1427 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1428#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1429#if defined(GL_PACK_ALIGNMENT)
1430 case GL_PACK_ALIGNMENT:
1431#endif // defined(GL_PACK_ALIGNMENT)
1432#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1433 case GL_PERSPECTIVE_CORRECTION_HINT:
1434#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1435#if defined(GL_POINT_SIZE)
1436 case GL_POINT_SIZE:
1437#endif // defined(GL_POINT_SIZE)
1438#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1439 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1440#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1441#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1442 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1443#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1444#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1445 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1446#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1447#if defined(GL_POINT_SMOOTH_HINT)
1448 case GL_POINT_SMOOTH_HINT:
1449#endif // defined(GL_POINT_SMOOTH_HINT)
1450#if defined(GL_POLYGON_OFFSET_FACTOR)
1451 case GL_POLYGON_OFFSET_FACTOR:
1452#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1453#if defined(GL_POLYGON_OFFSET_UNITS)
1454 case GL_POLYGON_OFFSET_UNITS:
1455#endif // defined(GL_POLYGON_OFFSET_UNITS)
1456#if defined(GL_PROJECTION_STACK_DEPTH)
1457 case GL_PROJECTION_STACK_DEPTH:
1458#endif // defined(GL_PROJECTION_STACK_DEPTH)
1459#if defined(GL_RED_BITS)
1460 case GL_RED_BITS:
1461#endif // defined(GL_RED_BITS)
1462#if defined(GL_SHADE_MODEL)
1463 case GL_SHADE_MODEL:
1464#endif // defined(GL_SHADE_MODEL)
1465#if defined(GL_STENCIL_BITS)
1466 case GL_STENCIL_BITS:
1467#endif // defined(GL_STENCIL_BITS)
1468#if defined(GL_STENCIL_CLEAR_VALUE)
1469 case GL_STENCIL_CLEAR_VALUE:
1470#endif // defined(GL_STENCIL_CLEAR_VALUE)
1471#if defined(GL_STENCIL_FAIL)
1472 case GL_STENCIL_FAIL:
1473#endif // defined(GL_STENCIL_FAIL)
1474#if defined(GL_STENCIL_FUNC)
1475 case GL_STENCIL_FUNC:
1476#endif // defined(GL_STENCIL_FUNC)
1477#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1478 case GL_STENCIL_PASS_DEPTH_FAIL:
1479#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1480#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1481 case GL_STENCIL_PASS_DEPTH_PASS:
1482#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1483#if defined(GL_STENCIL_REF)
1484 case GL_STENCIL_REF:
1485#endif // defined(GL_STENCIL_REF)
1486#if defined(GL_STENCIL_VALUE_MASK)
1487 case GL_STENCIL_VALUE_MASK:
1488#endif // defined(GL_STENCIL_VALUE_MASK)
1489#if defined(GL_STENCIL_WRITEMASK)
1490 case GL_STENCIL_WRITEMASK:
1491#endif // defined(GL_STENCIL_WRITEMASK)
1492#if defined(GL_SUBPIXEL_BITS)
1493 case GL_SUBPIXEL_BITS:
1494#endif // defined(GL_SUBPIXEL_BITS)
1495#if defined(GL_TEXTURE_BINDING_2D)
1496 case GL_TEXTURE_BINDING_2D:
1497#endif // defined(GL_TEXTURE_BINDING_2D)
1498#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1499 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1500#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1501#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1502 case GL_TEXTURE_COORD_ARRAY_SIZE:
1503#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1504#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1505 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1506#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1507#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1508 case GL_TEXTURE_COORD_ARRAY_TYPE:
1509#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1510#if defined(GL_TEXTURE_STACK_DEPTH)
1511 case GL_TEXTURE_STACK_DEPTH:
1512#endif // defined(GL_TEXTURE_STACK_DEPTH)
1513#if defined(GL_UNPACK_ALIGNMENT)
1514 case GL_UNPACK_ALIGNMENT:
1515#endif // defined(GL_UNPACK_ALIGNMENT)
1516#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1517 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1518#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1519#if defined(GL_VERTEX_ARRAY_SIZE)
1520 case GL_VERTEX_ARRAY_SIZE:
1521#endif // defined(GL_VERTEX_ARRAY_SIZE)
1522#if defined(GL_VERTEX_ARRAY_STRIDE)
1523 case GL_VERTEX_ARRAY_STRIDE:
1524#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1525#if defined(GL_VERTEX_ARRAY_TYPE)
1526 case GL_VERTEX_ARRAY_TYPE:
1527#endif // defined(GL_VERTEX_ARRAY_TYPE)
1528#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1529 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1530#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1531#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1532 case GL_WEIGHT_ARRAY_SIZE_OES:
1533#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1534#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1535 case GL_WEIGHT_ARRAY_STRIDE_OES:
1536#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1537#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1538 case GL_WEIGHT_ARRAY_TYPE_OES:
1539#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1540 _needed = 1;
1541 break;
1542#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1543 case GL_ALIASED_POINT_SIZE_RANGE:
1544#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1545#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1546 case GL_ALIASED_LINE_WIDTH_RANGE:
1547#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1548#if defined(GL_DEPTH_RANGE)
1549 case GL_DEPTH_RANGE:
1550#endif // defined(GL_DEPTH_RANGE)
1551#if defined(GL_MAX_VIEWPORT_DIMS)
1552 case GL_MAX_VIEWPORT_DIMS:
1553#endif // defined(GL_MAX_VIEWPORT_DIMS)
1554#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1555 case GL_SMOOTH_LINE_WIDTH_RANGE:
1556#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1557#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1558 case GL_SMOOTH_POINT_SIZE_RANGE:
1559#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1560 _needed = 2;
1561 break;
1562#if defined(GL_COLOR_CLEAR_VALUE)
1563 case GL_COLOR_CLEAR_VALUE:
1564#endif // defined(GL_COLOR_CLEAR_VALUE)
1565#if defined(GL_COLOR_WRITEMASK)
1566 case GL_COLOR_WRITEMASK:
1567#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001568#if defined(GL_FOG_COLOR)
1569 case GL_FOG_COLOR:
1570#endif // defined(GL_FOG_COLOR)
1571#if defined(GL_LIGHT_MODEL_AMBIENT)
1572 case GL_LIGHT_MODEL_AMBIENT:
1573#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001574#if defined(GL_SCISSOR_BOX)
1575 case GL_SCISSOR_BOX:
1576#endif // defined(GL_SCISSOR_BOX)
1577#if defined(GL_VIEWPORT)
1578 case GL_VIEWPORT:
1579#endif // defined(GL_VIEWPORT)
1580 _needed = 4;
1581 break;
1582#if defined(GL_MODELVIEW_MATRIX)
1583 case GL_MODELVIEW_MATRIX:
1584#endif // defined(GL_MODELVIEW_MATRIX)
1585#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1586 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1587#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1588#if defined(GL_PROJECTION_MATRIX)
1589 case GL_PROJECTION_MATRIX:
1590#endif // defined(GL_PROJECTION_MATRIX)
1591#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1592 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1593#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1594#if defined(GL_TEXTURE_MATRIX)
1595 case GL_TEXTURE_MATRIX:
1596#endif // defined(GL_TEXTURE_MATRIX)
1597#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1598 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1599#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1600 _needed = 16;
1601 break;
1602#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1603 case GL_COMPRESSED_TEXTURE_FORMATS:
1604#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001605 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001606 break;
1607 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001608 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001609 break;
1610 }
1611 if (_remaining < _needed) {
1612 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001613 _exceptionType = "java/lang/IllegalArgumentException";
1614 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001615 goto exit;
1616 }
1617 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001618 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001619 params = params_base + offset;
1620
1621 glGetIntegerv(
1622 (GLenum)pname,
1623 (GLint *)params
1624 );
1625
1626exit:
1627 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001628 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001629 _exception ? JNI_ABORT: 0);
1630 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001631 if (_exception) {
1632 jniThrowException(_env, _exceptionType, _exceptionMessage);
1633 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001634}
1635
1636/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1637static void
1638android_glGetIntegerv__ILjava_nio_IntBuffer_2
1639 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1640 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001641 const char * _exceptionType = NULL;
1642 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001643 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001644 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001645 jint _remaining;
1646 GLint *params = (GLint *) 0;
1647
Romain Guy84cac202016-12-05 12:26:02 -08001648 if (!params_buf) {
1649 _exception = 1;
1650 _exceptionType = "java/lang/IllegalArgumentException";
1651 _exceptionMessage = "params == null";
1652 goto exit;
1653 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001654 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001655 int _needed;
1656 switch (pname) {
1657#if defined(GL_ALPHA_BITS)
1658 case GL_ALPHA_BITS:
1659#endif // defined(GL_ALPHA_BITS)
1660#if defined(GL_ALPHA_TEST_FUNC)
1661 case GL_ALPHA_TEST_FUNC:
1662#endif // defined(GL_ALPHA_TEST_FUNC)
1663#if defined(GL_ALPHA_TEST_REF)
1664 case GL_ALPHA_TEST_REF:
1665#endif // defined(GL_ALPHA_TEST_REF)
1666#if defined(GL_BLEND_DST)
1667 case GL_BLEND_DST:
1668#endif // defined(GL_BLEND_DST)
1669#if defined(GL_BLUE_BITS)
1670 case GL_BLUE_BITS:
1671#endif // defined(GL_BLUE_BITS)
1672#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1673 case GL_COLOR_ARRAY_BUFFER_BINDING:
1674#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1675#if defined(GL_COLOR_ARRAY_SIZE)
1676 case GL_COLOR_ARRAY_SIZE:
1677#endif // defined(GL_COLOR_ARRAY_SIZE)
1678#if defined(GL_COLOR_ARRAY_STRIDE)
1679 case GL_COLOR_ARRAY_STRIDE:
1680#endif // defined(GL_COLOR_ARRAY_STRIDE)
1681#if defined(GL_COLOR_ARRAY_TYPE)
1682 case GL_COLOR_ARRAY_TYPE:
1683#endif // defined(GL_COLOR_ARRAY_TYPE)
1684#if defined(GL_CULL_FACE)
1685 case GL_CULL_FACE:
1686#endif // defined(GL_CULL_FACE)
1687#if defined(GL_DEPTH_BITS)
1688 case GL_DEPTH_BITS:
1689#endif // defined(GL_DEPTH_BITS)
1690#if defined(GL_DEPTH_CLEAR_VALUE)
1691 case GL_DEPTH_CLEAR_VALUE:
1692#endif // defined(GL_DEPTH_CLEAR_VALUE)
1693#if defined(GL_DEPTH_FUNC)
1694 case GL_DEPTH_FUNC:
1695#endif // defined(GL_DEPTH_FUNC)
1696#if defined(GL_DEPTH_WRITEMASK)
1697 case GL_DEPTH_WRITEMASK:
1698#endif // defined(GL_DEPTH_WRITEMASK)
1699#if defined(GL_FOG_DENSITY)
1700 case GL_FOG_DENSITY:
1701#endif // defined(GL_FOG_DENSITY)
1702#if defined(GL_FOG_END)
1703 case GL_FOG_END:
1704#endif // defined(GL_FOG_END)
1705#if defined(GL_FOG_MODE)
1706 case GL_FOG_MODE:
1707#endif // defined(GL_FOG_MODE)
1708#if defined(GL_FOG_START)
1709 case GL_FOG_START:
1710#endif // defined(GL_FOG_START)
1711#if defined(GL_FRONT_FACE)
1712 case GL_FRONT_FACE:
1713#endif // defined(GL_FRONT_FACE)
1714#if defined(GL_GREEN_BITS)
1715 case GL_GREEN_BITS:
1716#endif // defined(GL_GREEN_BITS)
1717#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1718 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1719#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1720#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1721 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1722#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001723#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1724 case GL_LIGHT_MODEL_COLOR_CONTROL:
1725#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1726#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1727 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1728#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001729#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1730 case GL_LIGHT_MODEL_TWO_SIDE:
1731#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1732#if defined(GL_LINE_SMOOTH_HINT)
1733 case GL_LINE_SMOOTH_HINT:
1734#endif // defined(GL_LINE_SMOOTH_HINT)
1735#if defined(GL_LINE_WIDTH)
1736 case GL_LINE_WIDTH:
1737#endif // defined(GL_LINE_WIDTH)
1738#if defined(GL_LOGIC_OP_MODE)
1739 case GL_LOGIC_OP_MODE:
1740#endif // defined(GL_LOGIC_OP_MODE)
1741#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1742 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1743#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1744#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1745 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1746#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1747#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1748 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1749#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1750#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1751 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1752#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1753#if defined(GL_MATRIX_MODE)
1754 case GL_MATRIX_MODE:
1755#endif // defined(GL_MATRIX_MODE)
1756#if defined(GL_MAX_CLIP_PLANES)
1757 case GL_MAX_CLIP_PLANES:
1758#endif // defined(GL_MAX_CLIP_PLANES)
1759#if defined(GL_MAX_ELEMENTS_INDICES)
1760 case GL_MAX_ELEMENTS_INDICES:
1761#endif // defined(GL_MAX_ELEMENTS_INDICES)
1762#if defined(GL_MAX_ELEMENTS_VERTICES)
1763 case GL_MAX_ELEMENTS_VERTICES:
1764#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1765#if defined(GL_MAX_LIGHTS)
1766 case GL_MAX_LIGHTS:
1767#endif // defined(GL_MAX_LIGHTS)
1768#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1769 case GL_MAX_MODELVIEW_STACK_DEPTH:
1770#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1771#if defined(GL_MAX_PALETTE_MATRICES_OES)
1772 case GL_MAX_PALETTE_MATRICES_OES:
1773#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1774#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1775 case GL_MAX_PROJECTION_STACK_DEPTH:
1776#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1777#if defined(GL_MAX_TEXTURE_SIZE)
1778 case GL_MAX_TEXTURE_SIZE:
1779#endif // defined(GL_MAX_TEXTURE_SIZE)
1780#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1781 case GL_MAX_TEXTURE_STACK_DEPTH:
1782#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1783#if defined(GL_MAX_TEXTURE_UNITS)
1784 case GL_MAX_TEXTURE_UNITS:
1785#endif // defined(GL_MAX_TEXTURE_UNITS)
1786#if defined(GL_MAX_VERTEX_UNITS_OES)
1787 case GL_MAX_VERTEX_UNITS_OES:
1788#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1789#if defined(GL_MODELVIEW_STACK_DEPTH)
1790 case GL_MODELVIEW_STACK_DEPTH:
1791#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1792#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1793 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1794#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1795#if defined(GL_NORMAL_ARRAY_STRIDE)
1796 case GL_NORMAL_ARRAY_STRIDE:
1797#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1798#if defined(GL_NORMAL_ARRAY_TYPE)
1799 case GL_NORMAL_ARRAY_TYPE:
1800#endif // defined(GL_NORMAL_ARRAY_TYPE)
1801#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1802 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1803#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1804#if defined(GL_PACK_ALIGNMENT)
1805 case GL_PACK_ALIGNMENT:
1806#endif // defined(GL_PACK_ALIGNMENT)
1807#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1808 case GL_PERSPECTIVE_CORRECTION_HINT:
1809#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1810#if defined(GL_POINT_SIZE)
1811 case GL_POINT_SIZE:
1812#endif // defined(GL_POINT_SIZE)
1813#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1814 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1815#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1816#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1817 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1818#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1819#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1820 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1821#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1822#if defined(GL_POINT_SMOOTH_HINT)
1823 case GL_POINT_SMOOTH_HINT:
1824#endif // defined(GL_POINT_SMOOTH_HINT)
1825#if defined(GL_POLYGON_OFFSET_FACTOR)
1826 case GL_POLYGON_OFFSET_FACTOR:
1827#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1828#if defined(GL_POLYGON_OFFSET_UNITS)
1829 case GL_POLYGON_OFFSET_UNITS:
1830#endif // defined(GL_POLYGON_OFFSET_UNITS)
1831#if defined(GL_PROJECTION_STACK_DEPTH)
1832 case GL_PROJECTION_STACK_DEPTH:
1833#endif // defined(GL_PROJECTION_STACK_DEPTH)
1834#if defined(GL_RED_BITS)
1835 case GL_RED_BITS:
1836#endif // defined(GL_RED_BITS)
1837#if defined(GL_SHADE_MODEL)
1838 case GL_SHADE_MODEL:
1839#endif // defined(GL_SHADE_MODEL)
1840#if defined(GL_STENCIL_BITS)
1841 case GL_STENCIL_BITS:
1842#endif // defined(GL_STENCIL_BITS)
1843#if defined(GL_STENCIL_CLEAR_VALUE)
1844 case GL_STENCIL_CLEAR_VALUE:
1845#endif // defined(GL_STENCIL_CLEAR_VALUE)
1846#if defined(GL_STENCIL_FAIL)
1847 case GL_STENCIL_FAIL:
1848#endif // defined(GL_STENCIL_FAIL)
1849#if defined(GL_STENCIL_FUNC)
1850 case GL_STENCIL_FUNC:
1851#endif // defined(GL_STENCIL_FUNC)
1852#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1853 case GL_STENCIL_PASS_DEPTH_FAIL:
1854#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1855#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1856 case GL_STENCIL_PASS_DEPTH_PASS:
1857#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1858#if defined(GL_STENCIL_REF)
1859 case GL_STENCIL_REF:
1860#endif // defined(GL_STENCIL_REF)
1861#if defined(GL_STENCIL_VALUE_MASK)
1862 case GL_STENCIL_VALUE_MASK:
1863#endif // defined(GL_STENCIL_VALUE_MASK)
1864#if defined(GL_STENCIL_WRITEMASK)
1865 case GL_STENCIL_WRITEMASK:
1866#endif // defined(GL_STENCIL_WRITEMASK)
1867#if defined(GL_SUBPIXEL_BITS)
1868 case GL_SUBPIXEL_BITS:
1869#endif // defined(GL_SUBPIXEL_BITS)
1870#if defined(GL_TEXTURE_BINDING_2D)
1871 case GL_TEXTURE_BINDING_2D:
1872#endif // defined(GL_TEXTURE_BINDING_2D)
1873#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1874 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1875#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1876#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1877 case GL_TEXTURE_COORD_ARRAY_SIZE:
1878#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1879#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1880 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1881#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1882#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1883 case GL_TEXTURE_COORD_ARRAY_TYPE:
1884#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1885#if defined(GL_TEXTURE_STACK_DEPTH)
1886 case GL_TEXTURE_STACK_DEPTH:
1887#endif // defined(GL_TEXTURE_STACK_DEPTH)
1888#if defined(GL_UNPACK_ALIGNMENT)
1889 case GL_UNPACK_ALIGNMENT:
1890#endif // defined(GL_UNPACK_ALIGNMENT)
1891#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1892 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1893#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1894#if defined(GL_VERTEX_ARRAY_SIZE)
1895 case GL_VERTEX_ARRAY_SIZE:
1896#endif // defined(GL_VERTEX_ARRAY_SIZE)
1897#if defined(GL_VERTEX_ARRAY_STRIDE)
1898 case GL_VERTEX_ARRAY_STRIDE:
1899#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1900#if defined(GL_VERTEX_ARRAY_TYPE)
1901 case GL_VERTEX_ARRAY_TYPE:
1902#endif // defined(GL_VERTEX_ARRAY_TYPE)
1903#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1904 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1905#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1906#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1907 case GL_WEIGHT_ARRAY_SIZE_OES:
1908#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1909#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1910 case GL_WEIGHT_ARRAY_STRIDE_OES:
1911#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1912#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1913 case GL_WEIGHT_ARRAY_TYPE_OES:
1914#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1915 _needed = 1;
1916 break;
1917#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1918 case GL_ALIASED_POINT_SIZE_RANGE:
1919#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1920#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1921 case GL_ALIASED_LINE_WIDTH_RANGE:
1922#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1923#if defined(GL_DEPTH_RANGE)
1924 case GL_DEPTH_RANGE:
1925#endif // defined(GL_DEPTH_RANGE)
1926#if defined(GL_MAX_VIEWPORT_DIMS)
1927 case GL_MAX_VIEWPORT_DIMS:
1928#endif // defined(GL_MAX_VIEWPORT_DIMS)
1929#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1930 case GL_SMOOTH_LINE_WIDTH_RANGE:
1931#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1932#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1933 case GL_SMOOTH_POINT_SIZE_RANGE:
1934#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1935 _needed = 2;
1936 break;
1937#if defined(GL_COLOR_CLEAR_VALUE)
1938 case GL_COLOR_CLEAR_VALUE:
1939#endif // defined(GL_COLOR_CLEAR_VALUE)
1940#if defined(GL_COLOR_WRITEMASK)
1941 case GL_COLOR_WRITEMASK:
1942#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001943#if defined(GL_FOG_COLOR)
1944 case GL_FOG_COLOR:
1945#endif // defined(GL_FOG_COLOR)
1946#if defined(GL_LIGHT_MODEL_AMBIENT)
1947 case GL_LIGHT_MODEL_AMBIENT:
1948#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001949#if defined(GL_SCISSOR_BOX)
1950 case GL_SCISSOR_BOX:
1951#endif // defined(GL_SCISSOR_BOX)
1952#if defined(GL_VIEWPORT)
1953 case GL_VIEWPORT:
1954#endif // defined(GL_VIEWPORT)
1955 _needed = 4;
1956 break;
1957#if defined(GL_MODELVIEW_MATRIX)
1958 case GL_MODELVIEW_MATRIX:
1959#endif // defined(GL_MODELVIEW_MATRIX)
1960#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1961 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1962#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1963#if defined(GL_PROJECTION_MATRIX)
1964 case GL_PROJECTION_MATRIX:
1965#endif // defined(GL_PROJECTION_MATRIX)
1966#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1967 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1968#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1969#if defined(GL_TEXTURE_MATRIX)
1970 case GL_TEXTURE_MATRIX:
1971#endif // defined(GL_TEXTURE_MATRIX)
1972#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1973 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1974#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1975 _needed = 16;
1976 break;
1977#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1978 case GL_COMPRESSED_TEXTURE_FORMATS:
1979#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001980 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001981 break;
1982 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001983 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001984 break;
1985 }
1986 if (_remaining < _needed) {
1987 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001988 _exceptionType = "java/lang/IllegalArgumentException";
1989 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001990 goto exit;
1991 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001992 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001993 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001994 params = (GLint *) (_paramsBase + _bufferOffset);
1995 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001996 glGetIntegerv(
1997 (GLenum)pname,
1998 (GLint *)params
1999 );
2000
2001exit:
2002 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002003 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002004 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002005 if (_exception) {
2006 jniThrowException(_env, _exceptionType, _exceptionMessage);
2007 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002008}
2009
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002010/* const GLubyte * glGetString ( GLenum name ) */
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07002011static jstring android_glGetString(JNIEnv *_env, jobject, jint name) {
2012 const char* chars = (const char*) glGetString((GLenum) name);
2013 return _env->NewStringUTF(chars);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002014}
2015/* void glHint ( GLenum target, GLenum mode ) */
2016static void
2017android_glHint__II
2018 (JNIEnv *_env, jobject _this, jint target, jint mode) {
2019 glHint(
2020 (GLenum)target,
2021 (GLenum)mode
2022 );
2023}
2024
2025/* void glLightModelf ( GLenum pname, GLfloat param ) */
2026static void
2027android_glLightModelf__IF
2028 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
2029 glLightModelf(
2030 (GLenum)pname,
2031 (GLfloat)param
2032 );
2033}
2034
2035/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
2036static void
2037android_glLightModelfv__I_3FI
2038 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002039 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002040 const char * _exceptionType = NULL;
2041 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002042 GLfloat *params_base = (GLfloat *) 0;
2043 jint _remaining;
2044 GLfloat *params = (GLfloat *) 0;
2045
2046 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002047 _exception = 1;
2048 _exceptionType = "java/lang/IllegalArgumentException";
2049 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002050 goto exit;
2051 }
2052 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002053 _exception = 1;
2054 _exceptionType = "java/lang/IllegalArgumentException";
2055 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002056 goto exit;
2057 }
2058 _remaining = _env->GetArrayLength(params_ref) - offset;
2059 int _needed;
2060 switch (pname) {
2061#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2062 case GL_LIGHT_MODEL_TWO_SIDE:
2063#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2064 _needed = 1;
2065 break;
2066#if defined(GL_LIGHT_MODEL_AMBIENT)
2067 case GL_LIGHT_MODEL_AMBIENT:
2068#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2069 _needed = 4;
2070 break;
2071 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002072 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002073 break;
2074 }
2075 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002076 _exception = 1;
2077 _exceptionType = "java/lang/IllegalArgumentException";
2078 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002079 goto exit;
2080 }
2081 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002082 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002083 params = params_base + offset;
2084
2085 glLightModelfv(
2086 (GLenum)pname,
2087 (GLfloat *)params
2088 );
2089
2090exit:
2091 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002092 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002093 JNI_ABORT);
2094 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002095 if (_exception) {
2096 jniThrowException(_env, _exceptionType, _exceptionMessage);
2097 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002098}
2099
2100/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
2101static void
2102android_glLightModelfv__ILjava_nio_FloatBuffer_2
2103 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002104 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002105 const char * _exceptionType = NULL;
2106 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002107 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002108 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002109 jint _remaining;
2110 GLfloat *params = (GLfloat *) 0;
2111
Romain Guy84cac202016-12-05 12:26:02 -08002112 if (!params_buf) {
2113 _exception = 1;
2114 _exceptionType = "java/lang/IllegalArgumentException";
2115 _exceptionMessage = "params == null";
2116 goto exit;
2117 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002118 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002119 int _needed;
2120 switch (pname) {
2121#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2122 case GL_LIGHT_MODEL_TWO_SIDE:
2123#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2124 _needed = 1;
2125 break;
2126#if defined(GL_LIGHT_MODEL_AMBIENT)
2127 case GL_LIGHT_MODEL_AMBIENT:
2128#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2129 _needed = 4;
2130 break;
2131 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002132 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002133 break;
2134 }
2135 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002136 _exception = 1;
2137 _exceptionType = "java/lang/IllegalArgumentException";
2138 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002139 goto exit;
2140 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002141 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002142 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002143 params = (GLfloat *) (_paramsBase + _bufferOffset);
2144 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002145 glLightModelfv(
2146 (GLenum)pname,
2147 (GLfloat *)params
2148 );
2149
2150exit:
2151 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002152 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002153 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002154 if (_exception) {
2155 jniThrowException(_env, _exceptionType, _exceptionMessage);
2156 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002157}
2158
2159/* void glLightModelx ( GLenum pname, GLfixed param ) */
2160static void
2161android_glLightModelx__II
2162 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2163 glLightModelx(
2164 (GLenum)pname,
2165 (GLfixed)param
2166 );
2167}
2168
2169/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2170static void
2171android_glLightModelxv__I_3II
2172 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002173 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002174 const char * _exceptionType = NULL;
2175 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002176 GLfixed *params_base = (GLfixed *) 0;
2177 jint _remaining;
2178 GLfixed *params = (GLfixed *) 0;
2179
2180 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002181 _exception = 1;
2182 _exceptionType = "java/lang/IllegalArgumentException";
2183 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002184 goto exit;
2185 }
2186 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002187 _exception = 1;
2188 _exceptionType = "java/lang/IllegalArgumentException";
2189 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002190 goto exit;
2191 }
2192 _remaining = _env->GetArrayLength(params_ref) - offset;
2193 int _needed;
2194 switch (pname) {
2195#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2196 case GL_LIGHT_MODEL_TWO_SIDE:
2197#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2198 _needed = 1;
2199 break;
2200#if defined(GL_LIGHT_MODEL_AMBIENT)
2201 case GL_LIGHT_MODEL_AMBIENT:
2202#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2203 _needed = 4;
2204 break;
2205 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002206 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002207 break;
2208 }
2209 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002210 _exception = 1;
2211 _exceptionType = "java/lang/IllegalArgumentException";
2212 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002213 goto exit;
2214 }
2215 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002216 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002217 params = params_base + offset;
2218
2219 glLightModelxv(
2220 (GLenum)pname,
2221 (GLfixed *)params
2222 );
2223
2224exit:
2225 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002226 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002227 JNI_ABORT);
2228 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002229 if (_exception) {
2230 jniThrowException(_env, _exceptionType, _exceptionMessage);
2231 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002232}
2233
2234/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2235static void
2236android_glLightModelxv__ILjava_nio_IntBuffer_2
2237 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002238 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002239 const char * _exceptionType = NULL;
2240 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002241 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002242 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002243 jint _remaining;
2244 GLfixed *params = (GLfixed *) 0;
2245
Romain Guy84cac202016-12-05 12:26:02 -08002246 if (!params_buf) {
2247 _exception = 1;
2248 _exceptionType = "java/lang/IllegalArgumentException";
2249 _exceptionMessage = "params == null";
2250 goto exit;
2251 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002252 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002253 int _needed;
2254 switch (pname) {
2255#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2256 case GL_LIGHT_MODEL_TWO_SIDE:
2257#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2258 _needed = 1;
2259 break;
2260#if defined(GL_LIGHT_MODEL_AMBIENT)
2261 case GL_LIGHT_MODEL_AMBIENT:
2262#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2263 _needed = 4;
2264 break;
2265 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002266 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002267 break;
2268 }
2269 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002270 _exception = 1;
2271 _exceptionType = "java/lang/IllegalArgumentException";
2272 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002273 goto exit;
2274 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002275 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002276 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002277 params = (GLfixed *) (_paramsBase + _bufferOffset);
2278 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002279 glLightModelxv(
2280 (GLenum)pname,
2281 (GLfixed *)params
2282 );
2283
2284exit:
2285 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002286 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002287 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002288 if (_exception) {
2289 jniThrowException(_env, _exceptionType, _exceptionMessage);
2290 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002291}
2292
2293/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
2294static void
2295android_glLightf__IIF
2296 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
2297 glLightf(
2298 (GLenum)light,
2299 (GLenum)pname,
2300 (GLfloat)param
2301 );
2302}
2303
2304/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2305static void
2306android_glLightfv__II_3FI
2307 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002308 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002309 const char * _exceptionType = NULL;
2310 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002311 GLfloat *params_base = (GLfloat *) 0;
2312 jint _remaining;
2313 GLfloat *params = (GLfloat *) 0;
2314
2315 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002316 _exception = 1;
2317 _exceptionType = "java/lang/IllegalArgumentException";
2318 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002319 goto exit;
2320 }
2321 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002322 _exception = 1;
2323 _exceptionType = "java/lang/IllegalArgumentException";
2324 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002325 goto exit;
2326 }
2327 _remaining = _env->GetArrayLength(params_ref) - offset;
2328 int _needed;
2329 switch (pname) {
2330#if defined(GL_SPOT_EXPONENT)
2331 case GL_SPOT_EXPONENT:
2332#endif // defined(GL_SPOT_EXPONENT)
2333#if defined(GL_SPOT_CUTOFF)
2334 case GL_SPOT_CUTOFF:
2335#endif // defined(GL_SPOT_CUTOFF)
2336#if defined(GL_CONSTANT_ATTENUATION)
2337 case GL_CONSTANT_ATTENUATION:
2338#endif // defined(GL_CONSTANT_ATTENUATION)
2339#if defined(GL_LINEAR_ATTENUATION)
2340 case GL_LINEAR_ATTENUATION:
2341#endif // defined(GL_LINEAR_ATTENUATION)
2342#if defined(GL_QUADRATIC_ATTENUATION)
2343 case GL_QUADRATIC_ATTENUATION:
2344#endif // defined(GL_QUADRATIC_ATTENUATION)
2345 _needed = 1;
2346 break;
2347#if defined(GL_SPOT_DIRECTION)
2348 case GL_SPOT_DIRECTION:
2349#endif // defined(GL_SPOT_DIRECTION)
2350 _needed = 3;
2351 break;
2352#if defined(GL_AMBIENT)
2353 case GL_AMBIENT:
2354#endif // defined(GL_AMBIENT)
2355#if defined(GL_DIFFUSE)
2356 case GL_DIFFUSE:
2357#endif // defined(GL_DIFFUSE)
2358#if defined(GL_SPECULAR)
2359 case GL_SPECULAR:
2360#endif // defined(GL_SPECULAR)
2361#if defined(GL_EMISSION)
2362 case GL_EMISSION:
2363#endif // defined(GL_EMISSION)
2364 _needed = 4;
2365 break;
2366 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002367 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002368 break;
2369 }
2370 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002371 _exception = 1;
2372 _exceptionType = "java/lang/IllegalArgumentException";
2373 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002374 goto exit;
2375 }
2376 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002377 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002378 params = params_base + offset;
2379
2380 glLightfv(
2381 (GLenum)light,
2382 (GLenum)pname,
2383 (GLfloat *)params
2384 );
2385
2386exit:
2387 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002388 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002389 JNI_ABORT);
2390 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002391 if (_exception) {
2392 jniThrowException(_env, _exceptionType, _exceptionMessage);
2393 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002394}
2395
2396/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2397static void
2398android_glLightfv__IILjava_nio_FloatBuffer_2
2399 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002400 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002401 const char * _exceptionType = NULL;
2402 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002403 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002404 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002405 jint _remaining;
2406 GLfloat *params = (GLfloat *) 0;
2407
Romain Guy84cac202016-12-05 12:26:02 -08002408 if (!params_buf) {
2409 _exception = 1;
2410 _exceptionType = "java/lang/IllegalArgumentException";
2411 _exceptionMessage = "params == null";
2412 goto exit;
2413 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002414 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002415 int _needed;
2416 switch (pname) {
2417#if defined(GL_SPOT_EXPONENT)
2418 case GL_SPOT_EXPONENT:
2419#endif // defined(GL_SPOT_EXPONENT)
2420#if defined(GL_SPOT_CUTOFF)
2421 case GL_SPOT_CUTOFF:
2422#endif // defined(GL_SPOT_CUTOFF)
2423#if defined(GL_CONSTANT_ATTENUATION)
2424 case GL_CONSTANT_ATTENUATION:
2425#endif // defined(GL_CONSTANT_ATTENUATION)
2426#if defined(GL_LINEAR_ATTENUATION)
2427 case GL_LINEAR_ATTENUATION:
2428#endif // defined(GL_LINEAR_ATTENUATION)
2429#if defined(GL_QUADRATIC_ATTENUATION)
2430 case GL_QUADRATIC_ATTENUATION:
2431#endif // defined(GL_QUADRATIC_ATTENUATION)
2432 _needed = 1;
2433 break;
2434#if defined(GL_SPOT_DIRECTION)
2435 case GL_SPOT_DIRECTION:
2436#endif // defined(GL_SPOT_DIRECTION)
2437 _needed = 3;
2438 break;
2439#if defined(GL_AMBIENT)
2440 case GL_AMBIENT:
2441#endif // defined(GL_AMBIENT)
2442#if defined(GL_DIFFUSE)
2443 case GL_DIFFUSE:
2444#endif // defined(GL_DIFFUSE)
2445#if defined(GL_SPECULAR)
2446 case GL_SPECULAR:
2447#endif // defined(GL_SPECULAR)
2448#if defined(GL_EMISSION)
2449 case GL_EMISSION:
2450#endif // defined(GL_EMISSION)
2451 _needed = 4;
2452 break;
2453 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002454 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002455 break;
2456 }
2457 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002458 _exception = 1;
2459 _exceptionType = "java/lang/IllegalArgumentException";
2460 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002461 goto exit;
2462 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002463 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002464 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002465 params = (GLfloat *) (_paramsBase + _bufferOffset);
2466 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002467 glLightfv(
2468 (GLenum)light,
2469 (GLenum)pname,
2470 (GLfloat *)params
2471 );
2472
2473exit:
2474 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002475 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002476 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002477 if (_exception) {
2478 jniThrowException(_env, _exceptionType, _exceptionMessage);
2479 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002480}
2481
2482/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
2483static void
2484android_glLightx__III
2485 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
2486 glLightx(
2487 (GLenum)light,
2488 (GLenum)pname,
2489 (GLfixed)param
2490 );
2491}
2492
2493/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2494static void
2495android_glLightxv__II_3II
2496 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002497 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002498 const char * _exceptionType = NULL;
2499 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002500 GLfixed *params_base = (GLfixed *) 0;
2501 jint _remaining;
2502 GLfixed *params = (GLfixed *) 0;
2503
2504 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002505 _exception = 1;
2506 _exceptionType = "java/lang/IllegalArgumentException";
2507 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002508 goto exit;
2509 }
2510 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002511 _exception = 1;
2512 _exceptionType = "java/lang/IllegalArgumentException";
2513 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002514 goto exit;
2515 }
2516 _remaining = _env->GetArrayLength(params_ref) - offset;
2517 int _needed;
2518 switch (pname) {
2519#if defined(GL_SPOT_EXPONENT)
2520 case GL_SPOT_EXPONENT:
2521#endif // defined(GL_SPOT_EXPONENT)
2522#if defined(GL_SPOT_CUTOFF)
2523 case GL_SPOT_CUTOFF:
2524#endif // defined(GL_SPOT_CUTOFF)
2525#if defined(GL_CONSTANT_ATTENUATION)
2526 case GL_CONSTANT_ATTENUATION:
2527#endif // defined(GL_CONSTANT_ATTENUATION)
2528#if defined(GL_LINEAR_ATTENUATION)
2529 case GL_LINEAR_ATTENUATION:
2530#endif // defined(GL_LINEAR_ATTENUATION)
2531#if defined(GL_QUADRATIC_ATTENUATION)
2532 case GL_QUADRATIC_ATTENUATION:
2533#endif // defined(GL_QUADRATIC_ATTENUATION)
2534 _needed = 1;
2535 break;
2536#if defined(GL_SPOT_DIRECTION)
2537 case GL_SPOT_DIRECTION:
2538#endif // defined(GL_SPOT_DIRECTION)
2539 _needed = 3;
2540 break;
2541#if defined(GL_AMBIENT)
2542 case GL_AMBIENT:
2543#endif // defined(GL_AMBIENT)
2544#if defined(GL_DIFFUSE)
2545 case GL_DIFFUSE:
2546#endif // defined(GL_DIFFUSE)
2547#if defined(GL_SPECULAR)
2548 case GL_SPECULAR:
2549#endif // defined(GL_SPECULAR)
2550#if defined(GL_EMISSION)
2551 case GL_EMISSION:
2552#endif // defined(GL_EMISSION)
2553 _needed = 4;
2554 break;
2555 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002556 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002557 break;
2558 }
2559 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002560 _exception = 1;
2561 _exceptionType = "java/lang/IllegalArgumentException";
2562 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002563 goto exit;
2564 }
2565 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002566 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002567 params = params_base + offset;
2568
2569 glLightxv(
2570 (GLenum)light,
2571 (GLenum)pname,
2572 (GLfixed *)params
2573 );
2574
2575exit:
2576 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002577 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002578 JNI_ABORT);
2579 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002580 if (_exception) {
2581 jniThrowException(_env, _exceptionType, _exceptionMessage);
2582 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002583}
2584
2585/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2586static void
2587android_glLightxv__IILjava_nio_IntBuffer_2
2588 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002589 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002590 const char * _exceptionType = NULL;
2591 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002592 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002593 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002594 jint _remaining;
2595 GLfixed *params = (GLfixed *) 0;
2596
Romain Guy84cac202016-12-05 12:26:02 -08002597 if (!params_buf) {
2598 _exception = 1;
2599 _exceptionType = "java/lang/IllegalArgumentException";
2600 _exceptionMessage = "params == null";
2601 goto exit;
2602 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002603 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002604 int _needed;
2605 switch (pname) {
2606#if defined(GL_SPOT_EXPONENT)
2607 case GL_SPOT_EXPONENT:
2608#endif // defined(GL_SPOT_EXPONENT)
2609#if defined(GL_SPOT_CUTOFF)
2610 case GL_SPOT_CUTOFF:
2611#endif // defined(GL_SPOT_CUTOFF)
2612#if defined(GL_CONSTANT_ATTENUATION)
2613 case GL_CONSTANT_ATTENUATION:
2614#endif // defined(GL_CONSTANT_ATTENUATION)
2615#if defined(GL_LINEAR_ATTENUATION)
2616 case GL_LINEAR_ATTENUATION:
2617#endif // defined(GL_LINEAR_ATTENUATION)
2618#if defined(GL_QUADRATIC_ATTENUATION)
2619 case GL_QUADRATIC_ATTENUATION:
2620#endif // defined(GL_QUADRATIC_ATTENUATION)
2621 _needed = 1;
2622 break;
2623#if defined(GL_SPOT_DIRECTION)
2624 case GL_SPOT_DIRECTION:
2625#endif // defined(GL_SPOT_DIRECTION)
2626 _needed = 3;
2627 break;
2628#if defined(GL_AMBIENT)
2629 case GL_AMBIENT:
2630#endif // defined(GL_AMBIENT)
2631#if defined(GL_DIFFUSE)
2632 case GL_DIFFUSE:
2633#endif // defined(GL_DIFFUSE)
2634#if defined(GL_SPECULAR)
2635 case GL_SPECULAR:
2636#endif // defined(GL_SPECULAR)
2637#if defined(GL_EMISSION)
2638 case GL_EMISSION:
2639#endif // defined(GL_EMISSION)
2640 _needed = 4;
2641 break;
2642 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002643 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002644 break;
2645 }
2646 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002647 _exception = 1;
2648 _exceptionType = "java/lang/IllegalArgumentException";
2649 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002650 goto exit;
2651 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002652 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002653 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002654 params = (GLfixed *) (_paramsBase + _bufferOffset);
2655 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002656 glLightxv(
2657 (GLenum)light,
2658 (GLenum)pname,
2659 (GLfixed *)params
2660 );
2661
2662exit:
2663 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002664 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002665 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002666 if (_exception) {
2667 jniThrowException(_env, _exceptionType, _exceptionMessage);
2668 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002669}
2670
2671/* void glLineWidth ( GLfloat width ) */
2672static void
2673android_glLineWidth__F
2674 (JNIEnv *_env, jobject _this, jfloat width) {
2675 glLineWidth(
2676 (GLfloat)width
2677 );
2678}
2679
2680/* void glLineWidthx ( GLfixed width ) */
2681static void
2682android_glLineWidthx__I
2683 (JNIEnv *_env, jobject _this, jint width) {
2684 glLineWidthx(
2685 (GLfixed)width
2686 );
2687}
2688
2689/* void glLoadIdentity ( void ) */
2690static void
2691android_glLoadIdentity__
2692 (JNIEnv *_env, jobject _this) {
2693 glLoadIdentity();
2694}
2695
2696/* void glLoadMatrixf ( const GLfloat *m ) */
2697static void
2698android_glLoadMatrixf___3FI
2699 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002700 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002701 const char * _exceptionType = NULL;
2702 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002703 GLfloat *m_base = (GLfloat *) 0;
2704 jint _remaining;
2705 GLfloat *m = (GLfloat *) 0;
2706
2707 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002708 _exception = 1;
2709 _exceptionType = "java/lang/IllegalArgumentException";
2710 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002711 goto exit;
2712 }
2713 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002714 _exception = 1;
2715 _exceptionType = "java/lang/IllegalArgumentException";
2716 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002717 goto exit;
2718 }
2719 _remaining = _env->GetArrayLength(m_ref) - offset;
2720 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002721 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002722 m = m_base + offset;
2723
2724 glLoadMatrixf(
2725 (GLfloat *)m
2726 );
2727
2728exit:
2729 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002730 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002731 JNI_ABORT);
2732 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002733 if (_exception) {
2734 jniThrowException(_env, _exceptionType, _exceptionMessage);
2735 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002736}
2737
2738/* void glLoadMatrixf ( const GLfloat *m ) */
2739static void
2740android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
2741 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002742 jint _exception = 0;
2743 const char * _exceptionType = NULL;
2744 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002745 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002746 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002747 jint _remaining;
2748 GLfloat *m = (GLfloat *) 0;
2749
Romain Guy84cac202016-12-05 12:26:02 -08002750 if (!m_buf) {
2751 _exception = 1;
2752 _exceptionType = "java/lang/IllegalArgumentException";
2753 _exceptionMessage = "m == null";
2754 goto exit;
2755 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002756 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002757 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002758 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002759 m = (GLfloat *) (_mBase + _bufferOffset);
2760 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002761 glLoadMatrixf(
2762 (GLfloat *)m
2763 );
Romain Guy84cac202016-12-05 12:26:02 -08002764
2765exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002766 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002767 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002768 }
Romain Guy84cac202016-12-05 12:26:02 -08002769 if (_exception) {
2770 jniThrowException(_env, _exceptionType, _exceptionMessage);
2771 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002772}
2773
2774/* void glLoadMatrixx ( const GLfixed *m ) */
2775static void
2776android_glLoadMatrixx___3II
2777 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002778 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002779 const char * _exceptionType = NULL;
2780 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002781 GLfixed *m_base = (GLfixed *) 0;
2782 jint _remaining;
2783 GLfixed *m = (GLfixed *) 0;
2784
2785 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002786 _exception = 1;
2787 _exceptionType = "java/lang/IllegalArgumentException";
2788 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002789 goto exit;
2790 }
2791 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002792 _exception = 1;
2793 _exceptionType = "java/lang/IllegalArgumentException";
2794 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002795 goto exit;
2796 }
2797 _remaining = _env->GetArrayLength(m_ref) - offset;
2798 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002799 _env->GetIntArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002800 m = m_base + offset;
2801
2802 glLoadMatrixx(
2803 (GLfixed *)m
2804 );
2805
2806exit:
2807 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002808 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002809 JNI_ABORT);
2810 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002811 if (_exception) {
2812 jniThrowException(_env, _exceptionType, _exceptionMessage);
2813 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002814}
2815
2816/* void glLoadMatrixx ( const GLfixed *m ) */
2817static void
2818android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2819 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002820 jint _exception = 0;
2821 const char * _exceptionType = NULL;
2822 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002823 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002824 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002825 jint _remaining;
2826 GLfixed *m = (GLfixed *) 0;
2827
Romain Guy84cac202016-12-05 12:26:02 -08002828 if (!m_buf) {
2829 _exception = 1;
2830 _exceptionType = "java/lang/IllegalArgumentException";
2831 _exceptionMessage = "m == null";
2832 goto exit;
2833 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002834 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002835 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002836 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002837 m = (GLfixed *) (_mBase + _bufferOffset);
2838 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002839 glLoadMatrixx(
2840 (GLfixed *)m
2841 );
Romain Guy84cac202016-12-05 12:26:02 -08002842
2843exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002844 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002845 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002846 }
Romain Guy84cac202016-12-05 12:26:02 -08002847 if (_exception) {
2848 jniThrowException(_env, _exceptionType, _exceptionMessage);
2849 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002850}
2851
2852/* void glLogicOp ( GLenum opcode ) */
2853static void
2854android_glLogicOp__I
2855 (JNIEnv *_env, jobject _this, jint opcode) {
2856 glLogicOp(
2857 (GLenum)opcode
2858 );
2859}
2860
2861/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2862static void
2863android_glMaterialf__IIF
2864 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2865 glMaterialf(
2866 (GLenum)face,
2867 (GLenum)pname,
2868 (GLfloat)param
2869 );
2870}
2871
2872/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2873static void
2874android_glMaterialfv__II_3FI
2875 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002876 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002877 const char * _exceptionType = NULL;
2878 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002879 GLfloat *params_base = (GLfloat *) 0;
2880 jint _remaining;
2881 GLfloat *params = (GLfloat *) 0;
2882
2883 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002884 _exception = 1;
2885 _exceptionType = "java/lang/IllegalArgumentException";
2886 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002887 goto exit;
2888 }
2889 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002890 _exception = 1;
2891 _exceptionType = "java/lang/IllegalArgumentException";
2892 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002893 goto exit;
2894 }
2895 _remaining = _env->GetArrayLength(params_ref) - offset;
2896 int _needed;
2897 switch (pname) {
2898#if defined(GL_SHININESS)
2899 case GL_SHININESS:
2900#endif // defined(GL_SHININESS)
2901 _needed = 1;
2902 break;
2903#if defined(GL_AMBIENT)
2904 case GL_AMBIENT:
2905#endif // defined(GL_AMBIENT)
2906#if defined(GL_DIFFUSE)
2907 case GL_DIFFUSE:
2908#endif // defined(GL_DIFFUSE)
2909#if defined(GL_SPECULAR)
2910 case GL_SPECULAR:
2911#endif // defined(GL_SPECULAR)
2912#if defined(GL_EMISSION)
2913 case GL_EMISSION:
2914#endif // defined(GL_EMISSION)
2915#if defined(GL_AMBIENT_AND_DIFFUSE)
2916 case GL_AMBIENT_AND_DIFFUSE:
2917#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2918 _needed = 4;
2919 break;
2920 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002921 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002922 break;
2923 }
2924 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002925 _exception = 1;
2926 _exceptionType = "java/lang/IllegalArgumentException";
2927 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002928 goto exit;
2929 }
2930 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002931 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002932 params = params_base + offset;
2933
2934 glMaterialfv(
2935 (GLenum)face,
2936 (GLenum)pname,
2937 (GLfloat *)params
2938 );
2939
2940exit:
2941 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002942 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002943 JNI_ABORT);
2944 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002945 if (_exception) {
2946 jniThrowException(_env, _exceptionType, _exceptionMessage);
2947 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002948}
2949
2950/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2951static void
2952android_glMaterialfv__IILjava_nio_FloatBuffer_2
2953 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002954 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002955 const char * _exceptionType = NULL;
2956 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002957 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002958 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002959 jint _remaining;
2960 GLfloat *params = (GLfloat *) 0;
2961
Romain Guy84cac202016-12-05 12:26:02 -08002962 if (!params_buf) {
2963 _exception = 1;
2964 _exceptionType = "java/lang/IllegalArgumentException";
2965 _exceptionMessage = "params == null";
2966 goto exit;
2967 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002968 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002969 int _needed;
2970 switch (pname) {
2971#if defined(GL_SHININESS)
2972 case GL_SHININESS:
2973#endif // defined(GL_SHININESS)
2974 _needed = 1;
2975 break;
2976#if defined(GL_AMBIENT)
2977 case GL_AMBIENT:
2978#endif // defined(GL_AMBIENT)
2979#if defined(GL_DIFFUSE)
2980 case GL_DIFFUSE:
2981#endif // defined(GL_DIFFUSE)
2982#if defined(GL_SPECULAR)
2983 case GL_SPECULAR:
2984#endif // defined(GL_SPECULAR)
2985#if defined(GL_EMISSION)
2986 case GL_EMISSION:
2987#endif // defined(GL_EMISSION)
2988#if defined(GL_AMBIENT_AND_DIFFUSE)
2989 case GL_AMBIENT_AND_DIFFUSE:
2990#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2991 _needed = 4;
2992 break;
2993 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002994 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002995 break;
2996 }
2997 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002998 _exception = 1;
2999 _exceptionType = "java/lang/IllegalArgumentException";
3000 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003001 goto exit;
3002 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003003 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003004 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003005 params = (GLfloat *) (_paramsBase + _bufferOffset);
3006 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003007 glMaterialfv(
3008 (GLenum)face,
3009 (GLenum)pname,
3010 (GLfloat *)params
3011 );
3012
3013exit:
3014 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003015 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003016 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003017 if (_exception) {
3018 jniThrowException(_env, _exceptionType, _exceptionMessage);
3019 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003020}
3021
3022/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
3023static void
3024android_glMaterialx__III
3025 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
3026 glMaterialx(
3027 (GLenum)face,
3028 (GLenum)pname,
3029 (GLfixed)param
3030 );
3031}
3032
3033/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
3034static void
3035android_glMaterialxv__II_3II
3036 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003037 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003038 const char * _exceptionType = NULL;
3039 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003040 GLfixed *params_base = (GLfixed *) 0;
3041 jint _remaining;
3042 GLfixed *params = (GLfixed *) 0;
3043
3044 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003045 _exception = 1;
3046 _exceptionType = "java/lang/IllegalArgumentException";
3047 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003048 goto exit;
3049 }
3050 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003051 _exception = 1;
3052 _exceptionType = "java/lang/IllegalArgumentException";
3053 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003054 goto exit;
3055 }
3056 _remaining = _env->GetArrayLength(params_ref) - offset;
3057 int _needed;
3058 switch (pname) {
3059#if defined(GL_SHININESS)
3060 case GL_SHININESS:
3061#endif // defined(GL_SHININESS)
3062 _needed = 1;
3063 break;
3064#if defined(GL_AMBIENT)
3065 case GL_AMBIENT:
3066#endif // defined(GL_AMBIENT)
3067#if defined(GL_DIFFUSE)
3068 case GL_DIFFUSE:
3069#endif // defined(GL_DIFFUSE)
3070#if defined(GL_SPECULAR)
3071 case GL_SPECULAR:
3072#endif // defined(GL_SPECULAR)
3073#if defined(GL_EMISSION)
3074 case GL_EMISSION:
3075#endif // defined(GL_EMISSION)
3076#if defined(GL_AMBIENT_AND_DIFFUSE)
3077 case GL_AMBIENT_AND_DIFFUSE:
3078#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3079 _needed = 4;
3080 break;
3081 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003082 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003083 break;
3084 }
3085 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003086 _exception = 1;
3087 _exceptionType = "java/lang/IllegalArgumentException";
3088 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003089 goto exit;
3090 }
3091 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003092 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003093 params = params_base + offset;
3094
3095 glMaterialxv(
3096 (GLenum)face,
3097 (GLenum)pname,
3098 (GLfixed *)params
3099 );
3100
3101exit:
3102 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003103 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003104 JNI_ABORT);
3105 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003106 if (_exception) {
3107 jniThrowException(_env, _exceptionType, _exceptionMessage);
3108 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003109}
3110
3111/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
3112static void
3113android_glMaterialxv__IILjava_nio_IntBuffer_2
3114 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003115 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003116 const char * _exceptionType = NULL;
3117 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003118 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003119 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003120 jint _remaining;
3121 GLfixed *params = (GLfixed *) 0;
3122
Romain Guy84cac202016-12-05 12:26:02 -08003123 if (!params_buf) {
3124 _exception = 1;
3125 _exceptionType = "java/lang/IllegalArgumentException";
3126 _exceptionMessage = "params == null";
3127 goto exit;
3128 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003129 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003130 int _needed;
3131 switch (pname) {
3132#if defined(GL_SHININESS)
3133 case GL_SHININESS:
3134#endif // defined(GL_SHININESS)
3135 _needed = 1;
3136 break;
3137#if defined(GL_AMBIENT)
3138 case GL_AMBIENT:
3139#endif // defined(GL_AMBIENT)
3140#if defined(GL_DIFFUSE)
3141 case GL_DIFFUSE:
3142#endif // defined(GL_DIFFUSE)
3143#if defined(GL_SPECULAR)
3144 case GL_SPECULAR:
3145#endif // defined(GL_SPECULAR)
3146#if defined(GL_EMISSION)
3147 case GL_EMISSION:
3148#endif // defined(GL_EMISSION)
3149#if defined(GL_AMBIENT_AND_DIFFUSE)
3150 case GL_AMBIENT_AND_DIFFUSE:
3151#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3152 _needed = 4;
3153 break;
3154 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003155 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003156 break;
3157 }
3158 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003159 _exception = 1;
3160 _exceptionType = "java/lang/IllegalArgumentException";
3161 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003162 goto exit;
3163 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003164 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003165 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003166 params = (GLfixed *) (_paramsBase + _bufferOffset);
3167 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003168 glMaterialxv(
3169 (GLenum)face,
3170 (GLenum)pname,
3171 (GLfixed *)params
3172 );
3173
3174exit:
3175 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003176 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003177 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003178 if (_exception) {
3179 jniThrowException(_env, _exceptionType, _exceptionMessage);
3180 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003181}
3182
3183/* void glMatrixMode ( GLenum mode ) */
3184static void
3185android_glMatrixMode__I
3186 (JNIEnv *_env, jobject _this, jint mode) {
3187 glMatrixMode(
3188 (GLenum)mode
3189 );
3190}
3191
3192/* void glMultMatrixf ( const GLfloat *m ) */
3193static void
3194android_glMultMatrixf___3FI
3195 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003196 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003197 const char * _exceptionType = NULL;
3198 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003199 GLfloat *m_base = (GLfloat *) 0;
3200 jint _remaining;
3201 GLfloat *m = (GLfloat *) 0;
3202
3203 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003204 _exception = 1;
3205 _exceptionType = "java/lang/IllegalArgumentException";
3206 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003207 goto exit;
3208 }
3209 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003210 _exception = 1;
3211 _exceptionType = "java/lang/IllegalArgumentException";
3212 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003213 goto exit;
3214 }
3215 _remaining = _env->GetArrayLength(m_ref) - offset;
3216 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003217 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003218 m = m_base + offset;
3219
3220 glMultMatrixf(
3221 (GLfloat *)m
3222 );
3223
3224exit:
3225 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003226 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003227 JNI_ABORT);
3228 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003229 if (_exception) {
3230 jniThrowException(_env, _exceptionType, _exceptionMessage);
3231 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003232}
3233
3234/* void glMultMatrixf ( const GLfloat *m ) */
3235static void
3236android_glMultMatrixf__Ljava_nio_FloatBuffer_2
3237 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003238 jint _exception = 0;
3239 const char * _exceptionType = NULL;
3240 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003241 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003242 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003243 jint _remaining;
3244 GLfloat *m = (GLfloat *) 0;
3245
Romain Guy84cac202016-12-05 12:26:02 -08003246 if (!m_buf) {
3247 _exception = 1;
3248 _exceptionType = "java/lang/IllegalArgumentException";
3249 _exceptionMessage = "m == null";
3250 goto exit;
3251 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003252 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003253 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003254 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003255 m = (GLfloat *) (_mBase + _bufferOffset);
3256 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003257 glMultMatrixf(
3258 (GLfloat *)m
3259 );
Romain Guy84cac202016-12-05 12:26:02 -08003260
3261exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003262 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003263 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003264 }
Romain Guy84cac202016-12-05 12:26:02 -08003265 if (_exception) {
3266 jniThrowException(_env, _exceptionType, _exceptionMessage);
3267 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003268}
3269
3270/* void glMultMatrixx ( const GLfixed *m ) */
3271static void
3272android_glMultMatrixx___3II
3273 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003274 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003275 const char * _exceptionType = NULL;
3276 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003277 GLfixed *m_base = (GLfixed *) 0;
3278 jint _remaining;
3279 GLfixed *m = (GLfixed *) 0;
3280
3281 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003282 _exception = 1;
3283 _exceptionType = "java/lang/IllegalArgumentException";
3284 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003285 goto exit;
3286 }
3287 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003288 _exception = 1;
3289 _exceptionType = "java/lang/IllegalArgumentException";
3290 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003291 goto exit;
3292 }
3293 _remaining = _env->GetArrayLength(m_ref) - offset;
3294 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003295 _env->GetIntArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003296 m = m_base + offset;
3297
3298 glMultMatrixx(
3299 (GLfixed *)m
3300 );
3301
3302exit:
3303 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003304 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003305 JNI_ABORT);
3306 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003307 if (_exception) {
3308 jniThrowException(_env, _exceptionType, _exceptionMessage);
3309 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003310}
3311
3312/* void glMultMatrixx ( const GLfixed *m ) */
3313static void
3314android_glMultMatrixx__Ljava_nio_IntBuffer_2
3315 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003316 jint _exception = 0;
3317 const char * _exceptionType = NULL;
3318 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003319 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003320 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003321 jint _remaining;
3322 GLfixed *m = (GLfixed *) 0;
3323
Romain Guy84cac202016-12-05 12:26:02 -08003324 if (!m_buf) {
3325 _exception = 1;
3326 _exceptionType = "java/lang/IllegalArgumentException";
3327 _exceptionMessage = "m == null";
3328 goto exit;
3329 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003330 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003331 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003332 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003333 m = (GLfixed *) (_mBase + _bufferOffset);
3334 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003335 glMultMatrixx(
3336 (GLfixed *)m
3337 );
Romain Guy84cac202016-12-05 12:26:02 -08003338
3339exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003340 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003341 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003342 }
Romain Guy84cac202016-12-05 12:26:02 -08003343 if (_exception) {
3344 jniThrowException(_env, _exceptionType, _exceptionMessage);
3345 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003346}
3347
3348/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
3349static void
3350android_glMultiTexCoord4f__IFFFF
3351 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
3352 glMultiTexCoord4f(
3353 (GLenum)target,
3354 (GLfloat)s,
3355 (GLfloat)t,
3356 (GLfloat)r,
3357 (GLfloat)q
3358 );
3359}
3360
3361/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
3362static void
3363android_glMultiTexCoord4x__IIIII
3364 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
3365 glMultiTexCoord4x(
3366 (GLenum)target,
3367 (GLfixed)s,
3368 (GLfixed)t,
3369 (GLfixed)r,
3370 (GLfixed)q
3371 );
3372}
3373
3374/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
3375static void
3376android_glNormal3f__FFF
3377 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
3378 glNormal3f(
3379 (GLfloat)nx,
3380 (GLfloat)ny,
3381 (GLfloat)nz
3382 );
3383}
3384
3385/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
3386static void
3387android_glNormal3x__III
3388 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
3389 glNormal3x(
3390 (GLfixed)nx,
3391 (GLfixed)ny,
3392 (GLfixed)nz
3393 );
3394}
3395
3396/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
3397static void
3398android_glNormalPointerBounds__IILjava_nio_Buffer_2I
3399 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08003400 jint _exception = 0;
3401 const char * _exceptionType = NULL;
3402 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003403 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003404 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003405 jint _remaining;
3406 GLvoid *pointer = (GLvoid *) 0;
3407
Jack Paleviche20ea782009-05-07 18:28:29 -07003408 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003409 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003410 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003411 return;
3412 }
3413 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003414 glNormalPointerBounds(
3415 (GLenum)type,
3416 (GLsizei)stride,
3417 (GLvoid *)pointer,
3418 (GLsizei)remaining
3419 );
Romain Guy84cac202016-12-05 12:26:02 -08003420 if (_exception) {
3421 jniThrowException(_env, _exceptionType, _exceptionMessage);
3422 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003423}
3424
3425/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
3426static void
3427android_glOrthof__FFFFFF
3428 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
3429 glOrthof(
3430 (GLfloat)left,
3431 (GLfloat)right,
3432 (GLfloat)bottom,
3433 (GLfloat)top,
3434 (GLfloat)zNear,
3435 (GLfloat)zFar
3436 );
3437}
3438
3439/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
3440static void
3441android_glOrthox__IIIIII
3442 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
3443 glOrthox(
3444 (GLfixed)left,
3445 (GLfixed)right,
3446 (GLfixed)bottom,
3447 (GLfixed)top,
3448 (GLfixed)zNear,
3449 (GLfixed)zFar
3450 );
3451}
3452
3453/* void glPixelStorei ( GLenum pname, GLint param ) */
3454static void
3455android_glPixelStorei__II
3456 (JNIEnv *_env, jobject _this, jint pname, jint param) {
3457 glPixelStorei(
3458 (GLenum)pname,
3459 (GLint)param
3460 );
3461}
3462
3463/* void glPointSize ( GLfloat size ) */
3464static void
3465android_glPointSize__F
3466 (JNIEnv *_env, jobject _this, jfloat size) {
3467 glPointSize(
3468 (GLfloat)size
3469 );
3470}
3471
3472/* void glPointSizex ( GLfixed size ) */
3473static void
3474android_glPointSizex__I
3475 (JNIEnv *_env, jobject _this, jint size) {
3476 glPointSizex(
3477 (GLfixed)size
3478 );
3479}
3480
3481/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
3482static void
3483android_glPolygonOffset__FF
3484 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
3485 glPolygonOffset(
3486 (GLfloat)factor,
3487 (GLfloat)units
3488 );
3489}
3490
3491/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
3492static void
3493android_glPolygonOffsetx__II
3494 (JNIEnv *_env, jobject _this, jint factor, jint units) {
3495 glPolygonOffsetx(
3496 (GLfixed)factor,
3497 (GLfixed)units
3498 );
3499}
3500
3501/* void glPopMatrix ( void ) */
3502static void
3503android_glPopMatrix__
3504 (JNIEnv *_env, jobject _this) {
3505 glPopMatrix();
3506}
3507
3508/* void glPushMatrix ( void ) */
3509static void
3510android_glPushMatrix__
3511 (JNIEnv *_env, jobject _this) {
3512 glPushMatrix();
3513}
3514
3515/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
3516static void
3517android_glReadPixels__IIIIIILjava_nio_Buffer_2
3518 (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 -08003519 jint _exception = 0;
3520 const char * _exceptionType = NULL;
3521 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003522 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003523 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003524 jint _remaining;
3525 GLvoid *pixels = (GLvoid *) 0;
3526
Romain Guy84cac202016-12-05 12:26:02 -08003527 if (!pixels_buf) {
3528 _exception = 1;
3529 _exceptionType = "java/lang/IllegalArgumentException";
3530 _exceptionMessage = "pixels == null";
3531 goto exit;
3532 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003533 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003534 if (pixels == NULL) {
3535 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3536 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3537 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003538 glReadPixels(
3539 (GLint)x,
3540 (GLint)y,
3541 (GLsizei)width,
3542 (GLsizei)height,
3543 (GLenum)format,
3544 (GLenum)type,
3545 (GLvoid *)pixels
3546 );
Romain Guy84cac202016-12-05 12:26:02 -08003547
3548exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003549 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08003550 releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE);
3551 }
3552 if (_exception) {
3553 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003554 }
3555}
3556
3557/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
3558static void
3559android_glRotatef__FFFF
3560 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
3561 glRotatef(
3562 (GLfloat)angle,
3563 (GLfloat)x,
3564 (GLfloat)y,
3565 (GLfloat)z
3566 );
3567}
3568
3569/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
3570static void
3571android_glRotatex__IIII
3572 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
3573 glRotatex(
3574 (GLfixed)angle,
3575 (GLfixed)x,
3576 (GLfixed)y,
3577 (GLfixed)z
3578 );
3579}
3580
3581/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
3582static void
3583android_glSampleCoverage__FZ
3584 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
3585 glSampleCoverage(
3586 (GLclampf)value,
3587 (GLboolean)invert
3588 );
3589}
3590
3591/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
3592static void
3593android_glSampleCoveragex__IZ
3594 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
3595 glSampleCoveragex(
3596 (GLclampx)value,
3597 (GLboolean)invert
3598 );
3599}
3600
3601/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
3602static void
3603android_glScalef__FFF
3604 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3605 glScalef(
3606 (GLfloat)x,
3607 (GLfloat)y,
3608 (GLfloat)z
3609 );
3610}
3611
3612/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
3613static void
3614android_glScalex__III
3615 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3616 glScalex(
3617 (GLfixed)x,
3618 (GLfixed)y,
3619 (GLfixed)z
3620 );
3621}
3622
3623/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3624static void
3625android_glScissor__IIII
3626 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3627 glScissor(
3628 (GLint)x,
3629 (GLint)y,
3630 (GLsizei)width,
3631 (GLsizei)height
3632 );
3633}
3634
3635/* void glShadeModel ( GLenum mode ) */
3636static void
3637android_glShadeModel__I
3638 (JNIEnv *_env, jobject _this, jint mode) {
3639 glShadeModel(
3640 (GLenum)mode
3641 );
3642}
3643
3644/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
3645static void
3646android_glStencilFunc__III
3647 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
3648 glStencilFunc(
3649 (GLenum)func,
3650 (GLint)ref,
3651 (GLuint)mask
3652 );
3653}
3654
3655/* void glStencilMask ( GLuint mask ) */
3656static void
3657android_glStencilMask__I
3658 (JNIEnv *_env, jobject _this, jint mask) {
3659 glStencilMask(
3660 (GLuint)mask
3661 );
3662}
3663
3664/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
3665static void
3666android_glStencilOp__III
3667 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
3668 glStencilOp(
3669 (GLenum)fail,
3670 (GLenum)zfail,
3671 (GLenum)zpass
3672 );
3673}
3674
3675/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3676static void
3677android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
3678 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08003679 jint _exception = 0;
3680 const char * _exceptionType = NULL;
3681 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003682 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003683 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003684 jint _remaining;
3685 GLvoid *pointer = (GLvoid *) 0;
3686
Jack Paleviche20ea782009-05-07 18:28:29 -07003687 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003688 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003689 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003690 return;
3691 }
3692 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003693 glTexCoordPointerBounds(
3694 (GLint)size,
3695 (GLenum)type,
3696 (GLsizei)stride,
3697 (GLvoid *)pointer,
3698 (GLsizei)remaining
3699 );
Romain Guy84cac202016-12-05 12:26:02 -08003700 if (_exception) {
3701 jniThrowException(_env, _exceptionType, _exceptionMessage);
3702 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003703}
3704
3705/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
3706static void
3707android_glTexEnvf__IIF
3708 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3709 glTexEnvf(
3710 (GLenum)target,
3711 (GLenum)pname,
3712 (GLfloat)param
3713 );
3714}
3715
3716/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3717static void
3718android_glTexEnvfv__II_3FI
3719 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003720 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003721 const char * _exceptionType = NULL;
3722 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003723 GLfloat *params_base = (GLfloat *) 0;
3724 jint _remaining;
3725 GLfloat *params = (GLfloat *) 0;
3726
3727 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003728 _exception = 1;
3729 _exceptionType = "java/lang/IllegalArgumentException";
3730 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003731 goto exit;
3732 }
3733 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003734 _exception = 1;
3735 _exceptionType = "java/lang/IllegalArgumentException";
3736 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003737 goto exit;
3738 }
3739 _remaining = _env->GetArrayLength(params_ref) - offset;
3740 int _needed;
3741 switch (pname) {
3742#if defined(GL_TEXTURE_ENV_MODE)
3743 case GL_TEXTURE_ENV_MODE:
3744#endif // defined(GL_TEXTURE_ENV_MODE)
3745#if defined(GL_COMBINE_RGB)
3746 case GL_COMBINE_RGB:
3747#endif // defined(GL_COMBINE_RGB)
3748#if defined(GL_COMBINE_ALPHA)
3749 case GL_COMBINE_ALPHA:
3750#endif // defined(GL_COMBINE_ALPHA)
3751 _needed = 1;
3752 break;
3753#if defined(GL_TEXTURE_ENV_COLOR)
3754 case GL_TEXTURE_ENV_COLOR:
3755#endif // defined(GL_TEXTURE_ENV_COLOR)
3756 _needed = 4;
3757 break;
3758 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003759 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003760 break;
3761 }
3762 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003763 _exception = 1;
3764 _exceptionType = "java/lang/IllegalArgumentException";
3765 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003766 goto exit;
3767 }
3768 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003769 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003770 params = params_base + offset;
3771
3772 glTexEnvfv(
3773 (GLenum)target,
3774 (GLenum)pname,
3775 (GLfloat *)params
3776 );
3777
3778exit:
3779 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003780 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003781 JNI_ABORT);
3782 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003783 if (_exception) {
3784 jniThrowException(_env, _exceptionType, _exceptionMessage);
3785 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003786}
3787
3788/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3789static void
3790android_glTexEnvfv__IILjava_nio_FloatBuffer_2
3791 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003792 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003793 const char * _exceptionType = NULL;
3794 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003795 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003796 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003797 jint _remaining;
3798 GLfloat *params = (GLfloat *) 0;
3799
Romain Guy84cac202016-12-05 12:26:02 -08003800 if (!params_buf) {
3801 _exception = 1;
3802 _exceptionType = "java/lang/IllegalArgumentException";
3803 _exceptionMessage = "params == null";
3804 goto exit;
3805 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003806 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003807 int _needed;
3808 switch (pname) {
3809#if defined(GL_TEXTURE_ENV_MODE)
3810 case GL_TEXTURE_ENV_MODE:
3811#endif // defined(GL_TEXTURE_ENV_MODE)
3812#if defined(GL_COMBINE_RGB)
3813 case GL_COMBINE_RGB:
3814#endif // defined(GL_COMBINE_RGB)
3815#if defined(GL_COMBINE_ALPHA)
3816 case GL_COMBINE_ALPHA:
3817#endif // defined(GL_COMBINE_ALPHA)
3818 _needed = 1;
3819 break;
3820#if defined(GL_TEXTURE_ENV_COLOR)
3821 case GL_TEXTURE_ENV_COLOR:
3822#endif // defined(GL_TEXTURE_ENV_COLOR)
3823 _needed = 4;
3824 break;
3825 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003826 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003827 break;
3828 }
3829 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003830 _exception = 1;
3831 _exceptionType = "java/lang/IllegalArgumentException";
3832 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003833 goto exit;
3834 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003835 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003836 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003837 params = (GLfloat *) (_paramsBase + _bufferOffset);
3838 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003839 glTexEnvfv(
3840 (GLenum)target,
3841 (GLenum)pname,
3842 (GLfloat *)params
3843 );
3844
3845exit:
3846 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003847 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003848 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003849 if (_exception) {
3850 jniThrowException(_env, _exceptionType, _exceptionMessage);
3851 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003852}
3853
3854/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
3855static void
3856android_glTexEnvx__III
3857 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3858 glTexEnvx(
3859 (GLenum)target,
3860 (GLenum)pname,
3861 (GLfixed)param
3862 );
3863}
3864
3865/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3866static void
3867android_glTexEnvxv__II_3II
3868 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003869 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003870 const char * _exceptionType = NULL;
3871 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003872 GLfixed *params_base = (GLfixed *) 0;
3873 jint _remaining;
3874 GLfixed *params = (GLfixed *) 0;
3875
3876 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003877 _exception = 1;
3878 _exceptionType = "java/lang/IllegalArgumentException";
3879 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003880 goto exit;
3881 }
3882 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003883 _exception = 1;
3884 _exceptionType = "java/lang/IllegalArgumentException";
3885 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003886 goto exit;
3887 }
3888 _remaining = _env->GetArrayLength(params_ref) - offset;
3889 int _needed;
3890 switch (pname) {
3891#if defined(GL_TEXTURE_ENV_MODE)
3892 case GL_TEXTURE_ENV_MODE:
3893#endif // defined(GL_TEXTURE_ENV_MODE)
3894#if defined(GL_COMBINE_RGB)
3895 case GL_COMBINE_RGB:
3896#endif // defined(GL_COMBINE_RGB)
3897#if defined(GL_COMBINE_ALPHA)
3898 case GL_COMBINE_ALPHA:
3899#endif // defined(GL_COMBINE_ALPHA)
3900 _needed = 1;
3901 break;
3902#if defined(GL_TEXTURE_ENV_COLOR)
3903 case GL_TEXTURE_ENV_COLOR:
3904#endif // defined(GL_TEXTURE_ENV_COLOR)
3905 _needed = 4;
3906 break;
3907 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003908 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003909 break;
3910 }
3911 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003912 _exception = 1;
3913 _exceptionType = "java/lang/IllegalArgumentException";
3914 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003915 goto exit;
3916 }
3917 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003918 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003919 params = params_base + offset;
3920
3921 glTexEnvxv(
3922 (GLenum)target,
3923 (GLenum)pname,
3924 (GLfixed *)params
3925 );
3926
3927exit:
3928 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003929 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003930 JNI_ABORT);
3931 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003932 if (_exception) {
3933 jniThrowException(_env, _exceptionType, _exceptionMessage);
3934 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003935}
3936
3937/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3938static void
3939android_glTexEnvxv__IILjava_nio_IntBuffer_2
3940 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003941 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003942 const char * _exceptionType = NULL;
3943 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003944 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003945 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003946 jint _remaining;
3947 GLfixed *params = (GLfixed *) 0;
3948
Romain Guy84cac202016-12-05 12:26:02 -08003949 if (!params_buf) {
3950 _exception = 1;
3951 _exceptionType = "java/lang/IllegalArgumentException";
3952 _exceptionMessage = "params == null";
3953 goto exit;
3954 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003955 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003956 int _needed;
3957 switch (pname) {
3958#if defined(GL_TEXTURE_ENV_MODE)
3959 case GL_TEXTURE_ENV_MODE:
3960#endif // defined(GL_TEXTURE_ENV_MODE)
3961#if defined(GL_COMBINE_RGB)
3962 case GL_COMBINE_RGB:
3963#endif // defined(GL_COMBINE_RGB)
3964#if defined(GL_COMBINE_ALPHA)
3965 case GL_COMBINE_ALPHA:
3966#endif // defined(GL_COMBINE_ALPHA)
3967 _needed = 1;
3968 break;
3969#if defined(GL_TEXTURE_ENV_COLOR)
3970 case GL_TEXTURE_ENV_COLOR:
3971#endif // defined(GL_TEXTURE_ENV_COLOR)
3972 _needed = 4;
3973 break;
3974 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003975 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003976 break;
3977 }
3978 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003979 _exception = 1;
3980 _exceptionType = "java/lang/IllegalArgumentException";
3981 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003982 goto exit;
3983 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003984 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003985 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003986 params = (GLfixed *) (_paramsBase + _bufferOffset);
3987 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003988 glTexEnvxv(
3989 (GLenum)target,
3990 (GLenum)pname,
3991 (GLfixed *)params
3992 );
3993
3994exit:
3995 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003996 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003997 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003998 if (_exception) {
3999 jniThrowException(_env, _exceptionType, _exceptionMessage);
4000 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004001}
4002
4003/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
4004static void
4005android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
4006 (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 -08004007 jint _exception = 0;
4008 const char * _exceptionType = NULL;
4009 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004010 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004011 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004012 jint _remaining;
4013 GLvoid *pixels = (GLvoid *) 0;
4014
4015 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004016 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004017 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004018 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004019 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4020 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004021 }
4022 glTexImage2D(
4023 (GLenum)target,
4024 (GLint)level,
4025 (GLint)internalformat,
4026 (GLsizei)width,
4027 (GLsizei)height,
4028 (GLint)border,
4029 (GLenum)format,
4030 (GLenum)type,
4031 (GLvoid *)pixels
4032 );
4033 if (_array) {
4034 releasePointer(_env, _array, pixels, JNI_FALSE);
4035 }
Romain Guy84cac202016-12-05 12:26:02 -08004036 if (_exception) {
4037 jniThrowException(_env, _exceptionType, _exceptionMessage);
4038 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004039}
4040
4041/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
4042static void
4043android_glTexParameterf__IIF
4044 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
4045 glTexParameterf(
4046 (GLenum)target,
4047 (GLenum)pname,
4048 (GLfloat)param
4049 );
4050}
4051
4052/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
4053static void
4054android_glTexParameterx__III
4055 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
4056 glTexParameterx(
4057 (GLenum)target,
4058 (GLenum)pname,
4059 (GLfixed)param
4060 );
4061}
4062
4063/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
4064static void
4065android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
4066 (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 -08004067 jint _exception = 0;
4068 const char * _exceptionType = NULL;
4069 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004070 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004071 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004072 jint _remaining;
4073 GLvoid *pixels = (GLvoid *) 0;
4074
4075 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004076 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004077 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004078 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004079 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4080 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004081 }
4082 glTexSubImage2D(
4083 (GLenum)target,
4084 (GLint)level,
4085 (GLint)xoffset,
4086 (GLint)yoffset,
4087 (GLsizei)width,
4088 (GLsizei)height,
4089 (GLenum)format,
4090 (GLenum)type,
4091 (GLvoid *)pixels
4092 );
4093 if (_array) {
4094 releasePointer(_env, _array, pixels, JNI_FALSE);
4095 }
Romain Guy84cac202016-12-05 12:26:02 -08004096 if (_exception) {
4097 jniThrowException(_env, _exceptionType, _exceptionMessage);
4098 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004099}
4100
4101/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
4102static void
4103android_glTranslatef__FFF
4104 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
4105 glTranslatef(
4106 (GLfloat)x,
4107 (GLfloat)y,
4108 (GLfloat)z
4109 );
4110}
4111
4112/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
4113static void
4114android_glTranslatex__III
4115 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
4116 glTranslatex(
4117 (GLfixed)x,
4118 (GLfixed)y,
4119 (GLfixed)z
4120 );
4121}
4122
4123/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
4124static void
4125android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
4126 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08004127 jint _exception = 0;
4128 const char * _exceptionType = NULL;
4129 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004130 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004131 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004132 jint _remaining;
4133 GLvoid *pointer = (GLvoid *) 0;
4134
Jack Paleviche20ea782009-05-07 18:28:29 -07004135 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07004136 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07004137 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07004138 return;
4139 }
4140 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004141 glVertexPointerBounds(
4142 (GLint)size,
4143 (GLenum)type,
4144 (GLsizei)stride,
4145 (GLvoid *)pointer,
4146 (GLsizei)remaining
4147 );
Romain Guy84cac202016-12-05 12:26:02 -08004148 if (_exception) {
4149 jniThrowException(_env, _exceptionType, _exceptionMessage);
4150 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004151}
4152
4153/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
4154static void
4155android_glViewport__IIII
4156 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
4157 glViewport(
4158 (GLint)x,
4159 (GLint)y,
4160 (GLsizei)width,
4161 (GLsizei)height
4162 );
4163}
4164
4165/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4166static jint
4167android_glQueryMatrixxOES___3II_3II
4168 (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) {
4169 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004170 const char * _exceptionType = NULL;
4171 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004172 GLbitfield _returnValue = -1;
4173 GLfixed *mantissa_base = (GLfixed *) 0;
4174 jint _mantissaRemaining;
4175 GLfixed *mantissa = (GLfixed *) 0;
4176 GLint *exponent_base = (GLint *) 0;
4177 jint _exponentRemaining;
4178 GLint *exponent = (GLint *) 0;
4179
4180 if (!mantissa_ref) {
4181 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004182 _exceptionType = "java/lang/IllegalArgumentException";
4183 _exceptionMessage = "mantissa == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004184 goto exit;
4185 }
4186 if (mantissaOffset < 0) {
4187 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004188 _exceptionType = "java/lang/IllegalArgumentException";
4189 _exceptionMessage = "mantissaOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004190 goto exit;
4191 }
4192 _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset;
4193 if (_mantissaRemaining < 16) {
4194 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004195 _exceptionType = "java/lang/IllegalArgumentException";
4196 _exceptionMessage = "length - mantissaOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004197 goto exit;
4198 }
4199 mantissa_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004200 _env->GetIntArrayElements(mantissa_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004201 mantissa = mantissa_base + mantissaOffset;
4202
4203 if (!exponent_ref) {
4204 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004205 _exceptionType = "java/lang/IllegalArgumentException";
4206 _exceptionMessage = "exponent == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004207 goto exit;
4208 }
4209 if (exponentOffset < 0) {
4210 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004211 _exceptionType = "java/lang/IllegalArgumentException";
4212 _exceptionMessage = "exponentOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004213 goto exit;
4214 }
4215 _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset;
4216 if (_exponentRemaining < 16) {
4217 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004218 _exceptionType = "java/lang/IllegalArgumentException";
4219 _exceptionMessage = "length - exponentOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004220 goto exit;
4221 }
4222 exponent_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004223 _env->GetIntArrayElements(exponent_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004224 exponent = exponent_base + exponentOffset;
4225
4226 _returnValue = glQueryMatrixxOES(
4227 (GLfixed *)mantissa,
4228 (GLint *)exponent
4229 );
4230
4231exit:
4232 if (exponent_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004233 _env->ReleaseIntArrayElements(exponent_ref, (jint*)exponent_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004234 _exception ? JNI_ABORT: 0);
4235 }
4236 if (mantissa_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004237 _env->ReleaseIntArrayElements(mantissa_ref, (jint*)mantissa_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004238 _exception ? JNI_ABORT: 0);
4239 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004240 if (_exception) {
4241 jniThrowException(_env, _exceptionType, _exceptionMessage);
4242 }
Elliott Hughes428d3fc2013-09-24 17:15:41 -07004243 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004244}
4245
4246/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4247static jint
4248android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
4249 (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) {
4250 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004251 const char * _exceptionType = NULL;
4252 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004253 jintArray _mantissaArray = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004254 jint _mantissaBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004255 jintArray _exponentArray = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004256 jint _exponentBufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004257 GLbitfield _returnValue = -1;
4258 jint _mantissaRemaining;
4259 GLfixed *mantissa = (GLfixed *) 0;
4260 jint _exponentRemaining;
4261 GLint *exponent = (GLint *) 0;
4262
Romain Guy84cac202016-12-05 12:26:02 -08004263 if (!mantissa_buf) {
4264 _exception = 1;
4265 _exceptionType = "java/lang/IllegalArgumentException";
4266 _exceptionMessage = "mantissa == null";
4267 goto exit;
4268 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004269 mantissa = (GLfixed *)getPointer(_env, mantissa_buf, (jarray*)&_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004270 if (_mantissaRemaining < 16) {
4271 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004272 _exceptionType = "java/lang/IllegalArgumentException";
4273 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004274 goto exit;
4275 }
Romain Guy84cac202016-12-05 12:26:02 -08004276 if (!exponent_buf) {
4277 _exception = 1;
4278 _exceptionType = "java/lang/IllegalArgumentException";
4279 _exceptionMessage = "exponent == null";
4280 goto exit;
4281 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004282 exponent = (GLint *)getPointer(_env, exponent_buf, (jarray*)&_exponentArray, &_exponentRemaining, &_exponentBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004283 if (_exponentRemaining < 16) {
4284 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004285 _exceptionType = "java/lang/IllegalArgumentException";
4286 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004287 goto exit;
4288 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004289 if (mantissa == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004290 char * _mantissaBase = (char *)_env->GetIntArrayElements(_mantissaArray, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004291 mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset);
4292 }
4293 if (exponent == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004294 char * _exponentBase = (char *)_env->GetIntArrayElements(_exponentArray, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004295 exponent = (GLint *) (_exponentBase + _exponentBufferOffset);
4296 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004297 _returnValue = glQueryMatrixxOES(
4298 (GLfixed *)mantissa,
4299 (GLint *)exponent
4300 );
4301
4302exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004303 if (_exponentArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004304 _env->ReleaseIntArrayElements(_exponentArray, (jint*)exponent, _exception ? JNI_ABORT : 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004305 }
4306 if (_mantissaArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004307 _env->ReleaseIntArrayElements(_mantissaArray, (jint*)mantissa, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004308 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004309 if (_exception) {
4310 jniThrowException(_env, _exceptionType, _exceptionMessage);
4311 }
Elliott Hughes428d3fc2013-09-24 17:15:41 -07004312 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004313}
4314
4315/* void glBindBuffer ( GLenum target, GLuint buffer ) */
4316static void
4317android_glBindBuffer__II
4318 (JNIEnv *_env, jobject _this, jint target, jint buffer) {
4319 glBindBuffer(
4320 (GLenum)target,
4321 (GLuint)buffer
4322 );
4323}
4324
4325/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */
4326static void
4327android_glBufferData__IILjava_nio_Buffer_2I
4328 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004329 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004330 const char * _exceptionType = NULL;
4331 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004332 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004333 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004334 jint _remaining;
4335 GLvoid *data = (GLvoid *) 0;
4336
4337 if (data_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004338 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004339 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004340 _exception = 1;
4341 _exceptionType = "java/lang/IllegalArgumentException";
4342 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004343 goto exit;
4344 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004345 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004346 if (data_buf && data == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004347 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4348 data = (GLvoid *) (_dataBase + _bufferOffset);
4349 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004350 glBufferData(
4351 (GLenum)target,
4352 (GLsizeiptr)size,
4353 (GLvoid *)data,
4354 (GLenum)usage
4355 );
Jack Palevichc620a522009-10-21 11:02:44 -07004356
4357exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004358 if (_array) {
4359 releasePointer(_env, _array, data, JNI_FALSE);
4360 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004361 if (_exception) {
4362 jniThrowException(_env, _exceptionType, _exceptionMessage);
4363 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004364}
4365
4366/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */
4367static void
4368android_glBufferSubData__IIILjava_nio_Buffer_2
4369 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004370 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004371 const char * _exceptionType = NULL;
4372 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004373 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004374 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004375 jint _remaining;
4376 GLvoid *data = (GLvoid *) 0;
4377
Romain Guy84cac202016-12-05 12:26:02 -08004378 if (!data_buf) {
4379 _exception = 1;
4380 _exceptionType = "java/lang/IllegalArgumentException";
4381 _exceptionMessage = "data == null";
4382 goto exit;
4383 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004384 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004385 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004386 _exception = 1;
4387 _exceptionType = "java/lang/IllegalArgumentException";
4388 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004389 goto exit;
4390 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004391 if (data == NULL) {
4392 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4393 data = (GLvoid *) (_dataBase + _bufferOffset);
4394 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004395 glBufferSubData(
4396 (GLenum)target,
4397 (GLintptr)offset,
4398 (GLsizeiptr)size,
4399 (GLvoid *)data
4400 );
Jack Palevichc620a522009-10-21 11:02:44 -07004401
4402exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004403 if (_array) {
4404 releasePointer(_env, _array, data, JNI_FALSE);
4405 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004406 if (_exception) {
4407 jniThrowException(_env, _exceptionType, _exceptionMessage);
4408 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004409}
4410
4411/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4412static void
4413android_glClipPlanef__I_3FI
4414 (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004415 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004416 const char * _exceptionType = NULL;
4417 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004418 GLfloat *equation_base = (GLfloat *) 0;
4419 jint _remaining;
4420 GLfloat *equation = (GLfloat *) 0;
4421
4422 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004423 _exception = 1;
4424 _exceptionType = "java/lang/IllegalArgumentException";
4425 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004426 goto exit;
4427 }
4428 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004429 _exception = 1;
4430 _exceptionType = "java/lang/IllegalArgumentException";
4431 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004432 goto exit;
4433 }
4434 _remaining = _env->GetArrayLength(equation_ref) - offset;
4435 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004436 _exception = 1;
4437 _exceptionType = "java/lang/IllegalArgumentException";
4438 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004439 goto exit;
4440 }
4441 equation_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004442 _env->GetFloatArrayElements(equation_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004443 equation = equation_base + offset;
4444
4445 glClipPlanef(
4446 (GLenum)plane,
4447 (GLfloat *)equation
4448 );
4449
4450exit:
4451 if (equation_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004452 _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004453 JNI_ABORT);
4454 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004455 if (_exception) {
4456 jniThrowException(_env, _exceptionType, _exceptionMessage);
4457 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004458}
4459
4460/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4461static void
4462android_glClipPlanef__ILjava_nio_FloatBuffer_2
4463 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004464 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004465 const char * _exceptionType = NULL;
4466 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004467 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004468 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004469 jint _remaining;
4470 GLfloat *equation = (GLfloat *) 0;
4471
Romain Guy84cac202016-12-05 12:26:02 -08004472 if (!equation_buf) {
4473 _exception = 1;
4474 _exceptionType = "java/lang/IllegalArgumentException";
4475 _exceptionMessage = "equation == null";
4476 goto exit;
4477 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004478 equation = (GLfloat *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004479 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004480 _exception = 1;
4481 _exceptionType = "java/lang/IllegalArgumentException";
4482 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004483 goto exit;
4484 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004485 if (equation == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004486 char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004487 equation = (GLfloat *) (_equationBase + _bufferOffset);
4488 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004489 glClipPlanef(
4490 (GLenum)plane,
4491 (GLfloat *)equation
4492 );
4493
4494exit:
4495 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004496 _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004497 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004498 if (_exception) {
4499 jniThrowException(_env, _exceptionType, _exceptionMessage);
4500 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004501}
4502
4503/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4504static void
4505android_glClipPlanex__I_3II
4506 (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004507 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004508 const char * _exceptionType = NULL;
4509 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004510 GLfixed *equation_base = (GLfixed *) 0;
4511 jint _remaining;
4512 GLfixed *equation = (GLfixed *) 0;
4513
4514 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004515 _exception = 1;
4516 _exceptionType = "java/lang/IllegalArgumentException";
4517 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004518 goto exit;
4519 }
4520 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004521 _exception = 1;
4522 _exceptionType = "java/lang/IllegalArgumentException";
4523 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004524 goto exit;
4525 }
4526 _remaining = _env->GetArrayLength(equation_ref) - offset;
4527 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004528 _exception = 1;
4529 _exceptionType = "java/lang/IllegalArgumentException";
4530 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004531 goto exit;
4532 }
4533 equation_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004534 _env->GetIntArrayElements(equation_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004535 equation = equation_base + offset;
4536
4537 glClipPlanex(
4538 (GLenum)plane,
4539 (GLfixed *)equation
4540 );
4541
4542exit:
4543 if (equation_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004544 _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004545 JNI_ABORT);
4546 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004547 if (_exception) {
4548 jniThrowException(_env, _exceptionType, _exceptionMessage);
4549 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004550}
4551
4552/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4553static void
4554android_glClipPlanex__ILjava_nio_IntBuffer_2
4555 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004556 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004557 const char * _exceptionType = NULL;
4558 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004559 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004560 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004561 jint _remaining;
4562 GLfixed *equation = (GLfixed *) 0;
4563
Romain Guy84cac202016-12-05 12:26:02 -08004564 if (!equation_buf) {
4565 _exception = 1;
4566 _exceptionType = "java/lang/IllegalArgumentException";
4567 _exceptionMessage = "equation == null";
4568 goto exit;
4569 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004570 equation = (GLfixed *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004571 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004572 _exception = 1;
4573 _exceptionType = "java/lang/IllegalArgumentException";
4574 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004575 goto exit;
4576 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004577 if (equation == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004578 char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004579 equation = (GLfixed *) (_equationBase + _bufferOffset);
4580 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004581 glClipPlanex(
4582 (GLenum)plane,
4583 (GLfixed *)equation
4584 );
4585
4586exit:
4587 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004588 _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004589 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004590 if (_exception) {
4591 jniThrowException(_env, _exceptionType, _exceptionMessage);
4592 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004593}
4594
4595/* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */
4596static void
4597android_glColor4ub__BBBB
4598 (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) {
4599 glColor4ub(
4600 (GLubyte)red,
4601 (GLubyte)green,
4602 (GLubyte)blue,
4603 (GLubyte)alpha
4604 );
4605}
4606
4607/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
4608static void
4609android_glColorPointer__IIII
4610 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
4611 glColorPointer(
4612 (GLint)size,
4613 (GLenum)type,
4614 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00004615 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004616 );
4617}
4618
4619/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4620static void
4621android_glDeleteBuffers__I_3II
4622 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004623 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004624 const char * _exceptionType = NULL;
4625 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004626 GLuint *buffers_base = (GLuint *) 0;
4627 jint _remaining;
4628 GLuint *buffers = (GLuint *) 0;
4629
4630 if (!buffers_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004631 _exception = 1;
4632 _exceptionType = "java/lang/IllegalArgumentException";
4633 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004634 goto exit;
4635 }
4636 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004637 _exception = 1;
4638 _exceptionType = "java/lang/IllegalArgumentException";
4639 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004640 goto exit;
4641 }
4642 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4643 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004644 _exception = 1;
4645 _exceptionType = "java/lang/IllegalArgumentException";
4646 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004647 goto exit;
4648 }
4649 buffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004650 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004651 buffers = buffers_base + offset;
4652
4653 glDeleteBuffers(
4654 (GLsizei)n,
4655 (GLuint *)buffers
4656 );
4657
4658exit:
4659 if (buffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004660 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004661 JNI_ABORT);
4662 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004663 if (_exception) {
4664 jniThrowException(_env, _exceptionType, _exceptionMessage);
4665 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004666}
4667
4668/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4669static void
4670android_glDeleteBuffers__ILjava_nio_IntBuffer_2
4671 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004672 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004673 const char * _exceptionType = NULL;
4674 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004675 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004676 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004677 jint _remaining;
4678 GLuint *buffers = (GLuint *) 0;
4679
Romain Guy84cac202016-12-05 12:26:02 -08004680 if (!buffers_buf) {
4681 _exception = 1;
4682 _exceptionType = "java/lang/IllegalArgumentException";
4683 _exceptionMessage = "buffers == null";
4684 goto exit;
4685 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004686 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004687 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004688 _exception = 1;
4689 _exceptionType = "java/lang/IllegalArgumentException";
4690 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004691 goto exit;
4692 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004693 if (buffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004694 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004695 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4696 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004697 glDeleteBuffers(
4698 (GLsizei)n,
4699 (GLuint *)buffers
4700 );
4701
4702exit:
4703 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004704 _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004705 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004706 if (_exception) {
4707 jniThrowException(_env, _exceptionType, _exceptionMessage);
4708 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004709}
4710
4711/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */
4712static void
4713android_glDrawElements__IIII
4714 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004715 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004716 const char * _exceptionType = NULL;
4717 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004718 glDrawElements(
4719 (GLenum)mode,
4720 (GLsizei)count,
4721 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00004722 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004723 );
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004724 if (_exception) {
4725 jniThrowException(_env, _exceptionType, _exceptionMessage);
4726 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004727}
4728
4729/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4730static void
4731android_glGenBuffers__I_3II
4732 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
4733 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004734 const char * _exceptionType = NULL;
4735 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004736 GLuint *buffers_base = (GLuint *) 0;
4737 jint _remaining;
4738 GLuint *buffers = (GLuint *) 0;
4739
4740 if (!buffers_ref) {
4741 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004742 _exceptionType = "java/lang/IllegalArgumentException";
4743 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004744 goto exit;
4745 }
4746 if (offset < 0) {
4747 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004748 _exceptionType = "java/lang/IllegalArgumentException";
4749 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004750 goto exit;
4751 }
4752 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4753 if (_remaining < n) {
4754 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004755 _exceptionType = "java/lang/IllegalArgumentException";
4756 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004757 goto exit;
4758 }
4759 buffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004760 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004761 buffers = buffers_base + offset;
4762
4763 glGenBuffers(
4764 (GLsizei)n,
4765 (GLuint *)buffers
4766 );
4767
4768exit:
4769 if (buffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004770 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004771 _exception ? JNI_ABORT: 0);
4772 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004773 if (_exception) {
4774 jniThrowException(_env, _exceptionType, _exceptionMessage);
4775 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004776}
4777
4778/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4779static void
4780android_glGenBuffers__ILjava_nio_IntBuffer_2
4781 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
4782 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004783 const char * _exceptionType = NULL;
4784 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004785 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004786 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004787 jint _remaining;
4788 GLuint *buffers = (GLuint *) 0;
4789
Romain Guy84cac202016-12-05 12:26:02 -08004790 if (!buffers_buf) {
4791 _exception = 1;
4792 _exceptionType = "java/lang/IllegalArgumentException";
4793 _exceptionMessage = "buffers == null";
4794 goto exit;
4795 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004796 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004797 if (_remaining < n) {
4798 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004799 _exceptionType = "java/lang/IllegalArgumentException";
4800 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004801 goto exit;
4802 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004803 if (buffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004804 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004805 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4806 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004807 glGenBuffers(
4808 (GLsizei)n,
4809 (GLuint *)buffers
4810 );
4811
4812exit:
4813 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004814 _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004815 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004816 if (_exception) {
4817 jniThrowException(_env, _exceptionType, _exceptionMessage);
4818 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004819}
4820
4821/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4822static void
4823android_glGetBooleanv__I_3ZI
4824 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
4825 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004826 const char * _exceptionType = NULL;
4827 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004828 GLboolean *params_base = (GLboolean *) 0;
4829 jint _remaining;
4830 GLboolean *params = (GLboolean *) 0;
4831
4832 if (!params_ref) {
4833 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004834 _exceptionType = "java/lang/IllegalArgumentException";
4835 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004836 goto exit;
4837 }
4838 if (offset < 0) {
4839 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004840 _exceptionType = "java/lang/IllegalArgumentException";
4841 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004842 goto exit;
4843 }
4844 _remaining = _env->GetArrayLength(params_ref) - offset;
4845 params_base = (GLboolean *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004846 _env->GetBooleanArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004847 params = params_base + offset;
4848
4849 glGetBooleanv(
4850 (GLenum)pname,
4851 (GLboolean *)params
4852 );
4853
4854exit:
4855 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004856 _env->ReleaseBooleanArrayElements(params_ref, (jboolean*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004857 _exception ? JNI_ABORT: 0);
4858 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004859 if (_exception) {
4860 jniThrowException(_env, _exceptionType, _exceptionMessage);
4861 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004862}
4863
4864/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4865static void
4866android_glGetBooleanv__ILjava_nio_IntBuffer_2
4867 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004868 jint _exception = 0;
4869 const char * _exceptionType = NULL;
4870 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004871 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004872 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004873 jint _remaining;
4874 GLboolean *params = (GLboolean *) 0;
4875
Romain Guy84cac202016-12-05 12:26:02 -08004876 if (!params_buf) {
4877 _exception = 1;
4878 _exceptionType = "java/lang/IllegalArgumentException";
4879 _exceptionMessage = "params == null";
4880 goto exit;
4881 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004882 params = (GLboolean *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004883 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004884 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004885 params = (GLboolean *) (_paramsBase + _bufferOffset);
4886 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004887 glGetBooleanv(
4888 (GLenum)pname,
4889 (GLboolean *)params
4890 );
Romain Guy84cac202016-12-05 12:26:02 -08004891
4892exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004893 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004894 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
4895 }
4896 if (_exception) {
4897 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004898 }
4899}
4900
4901/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4902static void
4903android_glGetBufferParameteriv__II_3II
4904 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004905 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004906 "glGetBufferParameteriv");
4907}
4908
4909/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4910static void
4911android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
4912 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004913 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004914 "glGetBufferParameteriv");
4915}
4916
4917/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4918static void
4919android_glGetClipPlanef__I_3FI
4920 (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
4921 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004922 const char * _exceptionType = NULL;
4923 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004924 GLfloat *eqn_base = (GLfloat *) 0;
4925 jint _remaining;
4926 GLfloat *eqn = (GLfloat *) 0;
4927
4928 if (!eqn_ref) {
4929 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004930 _exceptionType = "java/lang/IllegalArgumentException";
4931 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004932 goto exit;
4933 }
4934 if (offset < 0) {
4935 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004936 _exceptionType = "java/lang/IllegalArgumentException";
4937 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004938 goto exit;
4939 }
4940 _remaining = _env->GetArrayLength(eqn_ref) - offset;
4941 eqn_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004942 _env->GetFloatArrayElements(eqn_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004943 eqn = eqn_base + offset;
4944
4945 glGetClipPlanef(
4946 (GLenum)pname,
4947 (GLfloat *)eqn
4948 );
4949
4950exit:
4951 if (eqn_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004952 _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004953 _exception ? JNI_ABORT: 0);
4954 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004955 if (_exception) {
4956 jniThrowException(_env, _exceptionType, _exceptionMessage);
4957 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004958}
4959
4960/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4961static void
4962android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
4963 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004964 jint _exception = 0;
4965 const char * _exceptionType = NULL;
4966 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004967 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004968 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004969 jint _remaining;
4970 GLfloat *eqn = (GLfloat *) 0;
4971
Romain Guy84cac202016-12-05 12:26:02 -08004972 if (!eqn_buf) {
4973 _exception = 1;
4974 _exceptionType = "java/lang/IllegalArgumentException";
4975 _exceptionMessage = "eqn == null";
4976 goto exit;
4977 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004978 eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004979 if (eqn == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004980 char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004981 eqn = (GLfloat *) (_eqnBase + _bufferOffset);
4982 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004983 glGetClipPlanef(
4984 (GLenum)pname,
4985 (GLfloat *)eqn
4986 );
Romain Guy84cac202016-12-05 12:26:02 -08004987
4988exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004989 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004990 _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, _exception ? JNI_ABORT : 0);
4991 }
4992 if (_exception) {
4993 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004994 }
4995}
4996
4997/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
4998static void
4999android_glGetClipPlanex__I_3II
5000 (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
5001 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005002 const char * _exceptionType = NULL;
5003 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005004 GLfixed *eqn_base = (GLfixed *) 0;
5005 jint _remaining;
5006 GLfixed *eqn = (GLfixed *) 0;
5007
5008 if (!eqn_ref) {
5009 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005010 _exceptionType = "java/lang/IllegalArgumentException";
5011 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005012 goto exit;
5013 }
5014 if (offset < 0) {
5015 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005016 _exceptionType = "java/lang/IllegalArgumentException";
5017 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005018 goto exit;
5019 }
5020 _remaining = _env->GetArrayLength(eqn_ref) - offset;
5021 eqn_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005022 _env->GetIntArrayElements(eqn_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005023 eqn = eqn_base + offset;
5024
5025 glGetClipPlanex(
5026 (GLenum)pname,
5027 (GLfixed *)eqn
5028 );
5029
5030exit:
5031 if (eqn_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005032 _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005033 _exception ? JNI_ABORT: 0);
5034 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005035 if (_exception) {
5036 jniThrowException(_env, _exceptionType, _exceptionMessage);
5037 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005038}
5039
5040/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
5041static void
5042android_glGetClipPlanex__ILjava_nio_IntBuffer_2
5043 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005044 jint _exception = 0;
5045 const char * _exceptionType = NULL;
5046 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005047 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005048 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005049 jint _remaining;
5050 GLfixed *eqn = (GLfixed *) 0;
5051
Romain Guy84cac202016-12-05 12:26:02 -08005052 if (!eqn_buf) {
5053 _exception = 1;
5054 _exceptionType = "java/lang/IllegalArgumentException";
5055 _exceptionMessage = "eqn == null";
5056 goto exit;
5057 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005058 eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005059 if (eqn == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005060 char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005061 eqn = (GLfixed *) (_eqnBase + _bufferOffset);
5062 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005063 glGetClipPlanex(
5064 (GLenum)pname,
5065 (GLfixed *)eqn
5066 );
Romain Guy84cac202016-12-05 12:26:02 -08005067
5068exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005069 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005070 _env->ReleaseIntArrayElements(_array, (jint*)eqn, _exception ? JNI_ABORT : 0);
5071 }
5072 if (_exception) {
5073 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005074 }
5075}
5076
5077/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
5078static void
5079android_glGetFixedv__I_3II
5080 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
5081 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005082 const char * _exceptionType = NULL;
5083 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005084 GLfixed *params_base = (GLfixed *) 0;
5085 jint _remaining;
5086 GLfixed *params = (GLfixed *) 0;
5087
5088 if (!params_ref) {
5089 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005090 _exceptionType = "java/lang/IllegalArgumentException";
5091 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005092 goto exit;
5093 }
5094 if (offset < 0) {
5095 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005096 _exceptionType = "java/lang/IllegalArgumentException";
5097 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005098 goto exit;
5099 }
5100 _remaining = _env->GetArrayLength(params_ref) - offset;
5101 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005102 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005103 params = params_base + offset;
5104
5105 glGetFixedv(
5106 (GLenum)pname,
5107 (GLfixed *)params
5108 );
5109
5110exit:
5111 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005112 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005113 _exception ? JNI_ABORT: 0);
5114 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005115 if (_exception) {
5116 jniThrowException(_env, _exceptionType, _exceptionMessage);
5117 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005118}
5119
5120/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
5121static void
5122android_glGetFixedv__ILjava_nio_IntBuffer_2
5123 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005124 jint _exception = 0;
5125 const char * _exceptionType = NULL;
5126 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005127 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005128 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005129 jint _remaining;
5130 GLfixed *params = (GLfixed *) 0;
5131
Romain Guy84cac202016-12-05 12:26:02 -08005132 if (!params_buf) {
5133 _exception = 1;
5134 _exceptionType = "java/lang/IllegalArgumentException";
5135 _exceptionMessage = "params == null";
5136 goto exit;
5137 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005138 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005139 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005140 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005141 params = (GLfixed *) (_paramsBase + _bufferOffset);
5142 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005143 glGetFixedv(
5144 (GLenum)pname,
5145 (GLfixed *)params
5146 );
Romain Guy84cac202016-12-05 12:26:02 -08005147
5148exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005149 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005150 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5151 }
5152 if (_exception) {
5153 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005154 }
5155}
5156
5157/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
5158static void
5159android_glGetFloatv__I_3FI
5160 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
5161 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005162 const char * _exceptionType = NULL;
5163 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005164 GLfloat *params_base = (GLfloat *) 0;
5165 jint _remaining;
5166 GLfloat *params = (GLfloat *) 0;
5167
5168 if (!params_ref) {
5169 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005170 _exceptionType = "java/lang/IllegalArgumentException";
5171 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005172 goto exit;
5173 }
5174 if (offset < 0) {
5175 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005176 _exceptionType = "java/lang/IllegalArgumentException";
5177 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005178 goto exit;
5179 }
5180 _remaining = _env->GetArrayLength(params_ref) - offset;
5181 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005182 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005183 params = params_base + offset;
5184
5185 glGetFloatv(
5186 (GLenum)pname,
5187 (GLfloat *)params
5188 );
5189
5190exit:
5191 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005192 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005193 _exception ? JNI_ABORT: 0);
5194 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005195 if (_exception) {
5196 jniThrowException(_env, _exceptionType, _exceptionMessage);
5197 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005198}
5199
5200/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
5201static void
5202android_glGetFloatv__ILjava_nio_FloatBuffer_2
5203 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005204 jint _exception = 0;
5205 const char * _exceptionType = NULL;
5206 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005207 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005208 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005209 jint _remaining;
5210 GLfloat *params = (GLfloat *) 0;
5211
Romain Guy84cac202016-12-05 12:26:02 -08005212 if (!params_buf) {
5213 _exception = 1;
5214 _exceptionType = "java/lang/IllegalArgumentException";
5215 _exceptionMessage = "params == null";
5216 goto exit;
5217 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005218 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005219 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005220 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005221 params = (GLfloat *) (_paramsBase + _bufferOffset);
5222 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005223 glGetFloatv(
5224 (GLenum)pname,
5225 (GLfloat *)params
5226 );
Romain Guy84cac202016-12-05 12:26:02 -08005227
5228exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005229 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005230 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
5231 }
5232 if (_exception) {
5233 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005234 }
5235}
5236
5237/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
5238static void
5239android_glGetLightfv__II_3FI
5240 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
5241 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005242 const char * _exceptionType = NULL;
5243 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005244 GLfloat *params_base = (GLfloat *) 0;
5245 jint _remaining;
5246 GLfloat *params = (GLfloat *) 0;
5247
5248 if (!params_ref) {
5249 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005250 _exceptionType = "java/lang/IllegalArgumentException";
5251 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005252 goto exit;
5253 }
5254 if (offset < 0) {
5255 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005256 _exceptionType = "java/lang/IllegalArgumentException";
5257 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005258 goto exit;
5259 }
5260 _remaining = _env->GetArrayLength(params_ref) - offset;
5261 int _needed;
5262 switch (pname) {
5263#if defined(GL_SPOT_EXPONENT)
5264 case GL_SPOT_EXPONENT:
5265#endif // defined(GL_SPOT_EXPONENT)
5266#if defined(GL_SPOT_CUTOFF)
5267 case GL_SPOT_CUTOFF:
5268#endif // defined(GL_SPOT_CUTOFF)
5269#if defined(GL_CONSTANT_ATTENUATION)
5270 case GL_CONSTANT_ATTENUATION:
5271#endif // defined(GL_CONSTANT_ATTENUATION)
5272#if defined(GL_LINEAR_ATTENUATION)
5273 case GL_LINEAR_ATTENUATION:
5274#endif // defined(GL_LINEAR_ATTENUATION)
5275#if defined(GL_QUADRATIC_ATTENUATION)
5276 case GL_QUADRATIC_ATTENUATION:
5277#endif // defined(GL_QUADRATIC_ATTENUATION)
5278 _needed = 1;
5279 break;
5280#if defined(GL_SPOT_DIRECTION)
5281 case GL_SPOT_DIRECTION:
5282#endif // defined(GL_SPOT_DIRECTION)
5283 _needed = 3;
5284 break;
5285#if defined(GL_AMBIENT)
5286 case GL_AMBIENT:
5287#endif // defined(GL_AMBIENT)
5288#if defined(GL_DIFFUSE)
5289 case GL_DIFFUSE:
5290#endif // defined(GL_DIFFUSE)
5291#if defined(GL_SPECULAR)
5292 case GL_SPECULAR:
5293#endif // defined(GL_SPECULAR)
5294#if defined(GL_EMISSION)
5295 case GL_EMISSION:
5296#endif // defined(GL_EMISSION)
5297 _needed = 4;
5298 break;
5299 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005300 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005301 break;
5302 }
5303 if (_remaining < _needed) {
5304 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005305 _exceptionType = "java/lang/IllegalArgumentException";
5306 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005307 goto exit;
5308 }
5309 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005310 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005311 params = params_base + offset;
5312
5313 glGetLightfv(
5314 (GLenum)light,
5315 (GLenum)pname,
5316 (GLfloat *)params
5317 );
5318
5319exit:
5320 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005321 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005322 _exception ? JNI_ABORT: 0);
5323 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005324 if (_exception) {
5325 jniThrowException(_env, _exceptionType, _exceptionMessage);
5326 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005327}
5328
5329/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
5330static void
5331android_glGetLightfv__IILjava_nio_FloatBuffer_2
5332 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5333 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005334 const char * _exceptionType = NULL;
5335 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005336 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005337 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005338 jint _remaining;
5339 GLfloat *params = (GLfloat *) 0;
5340
Romain Guy84cac202016-12-05 12:26:02 -08005341 if (!params_buf) {
5342 _exception = 1;
5343 _exceptionType = "java/lang/IllegalArgumentException";
5344 _exceptionMessage = "params == null";
5345 goto exit;
5346 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005347 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005348 int _needed;
5349 switch (pname) {
5350#if defined(GL_SPOT_EXPONENT)
5351 case GL_SPOT_EXPONENT:
5352#endif // defined(GL_SPOT_EXPONENT)
5353#if defined(GL_SPOT_CUTOFF)
5354 case GL_SPOT_CUTOFF:
5355#endif // defined(GL_SPOT_CUTOFF)
5356#if defined(GL_CONSTANT_ATTENUATION)
5357 case GL_CONSTANT_ATTENUATION:
5358#endif // defined(GL_CONSTANT_ATTENUATION)
5359#if defined(GL_LINEAR_ATTENUATION)
5360 case GL_LINEAR_ATTENUATION:
5361#endif // defined(GL_LINEAR_ATTENUATION)
5362#if defined(GL_QUADRATIC_ATTENUATION)
5363 case GL_QUADRATIC_ATTENUATION:
5364#endif // defined(GL_QUADRATIC_ATTENUATION)
5365 _needed = 1;
5366 break;
5367#if defined(GL_SPOT_DIRECTION)
5368 case GL_SPOT_DIRECTION:
5369#endif // defined(GL_SPOT_DIRECTION)
5370 _needed = 3;
5371 break;
5372#if defined(GL_AMBIENT)
5373 case GL_AMBIENT:
5374#endif // defined(GL_AMBIENT)
5375#if defined(GL_DIFFUSE)
5376 case GL_DIFFUSE:
5377#endif // defined(GL_DIFFUSE)
5378#if defined(GL_SPECULAR)
5379 case GL_SPECULAR:
5380#endif // defined(GL_SPECULAR)
5381#if defined(GL_EMISSION)
5382 case GL_EMISSION:
5383#endif // defined(GL_EMISSION)
5384 _needed = 4;
5385 break;
5386 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005387 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005388 break;
5389 }
5390 if (_remaining < _needed) {
5391 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005392 _exceptionType = "java/lang/IllegalArgumentException";
5393 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005394 goto exit;
5395 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005396 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005397 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005398 params = (GLfloat *) (_paramsBase + _bufferOffset);
5399 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005400 glGetLightfv(
5401 (GLenum)light,
5402 (GLenum)pname,
5403 (GLfloat *)params
5404 );
5405
5406exit:
5407 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005408 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005409 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005410 if (_exception) {
5411 jniThrowException(_env, _exceptionType, _exceptionMessage);
5412 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005413}
5414
5415/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5416static void
5417android_glGetLightxv__II_3II
5418 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
5419 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005420 const char * _exceptionType = NULL;
5421 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005422 GLfixed *params_base = (GLfixed *) 0;
5423 jint _remaining;
5424 GLfixed *params = (GLfixed *) 0;
5425
5426 if (!params_ref) {
5427 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005428 _exceptionType = "java/lang/IllegalArgumentException";
5429 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005430 goto exit;
5431 }
5432 if (offset < 0) {
5433 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005434 _exceptionType = "java/lang/IllegalArgumentException";
5435 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005436 goto exit;
5437 }
5438 _remaining = _env->GetArrayLength(params_ref) - offset;
5439 int _needed;
5440 switch (pname) {
5441#if defined(GL_SPOT_EXPONENT)
5442 case GL_SPOT_EXPONENT:
5443#endif // defined(GL_SPOT_EXPONENT)
5444#if defined(GL_SPOT_CUTOFF)
5445 case GL_SPOT_CUTOFF:
5446#endif // defined(GL_SPOT_CUTOFF)
5447#if defined(GL_CONSTANT_ATTENUATION)
5448 case GL_CONSTANT_ATTENUATION:
5449#endif // defined(GL_CONSTANT_ATTENUATION)
5450#if defined(GL_LINEAR_ATTENUATION)
5451 case GL_LINEAR_ATTENUATION:
5452#endif // defined(GL_LINEAR_ATTENUATION)
5453#if defined(GL_QUADRATIC_ATTENUATION)
5454 case GL_QUADRATIC_ATTENUATION:
5455#endif // defined(GL_QUADRATIC_ATTENUATION)
5456 _needed = 1;
5457 break;
5458#if defined(GL_SPOT_DIRECTION)
5459 case GL_SPOT_DIRECTION:
5460#endif // defined(GL_SPOT_DIRECTION)
5461 _needed = 3;
5462 break;
5463#if defined(GL_AMBIENT)
5464 case GL_AMBIENT:
5465#endif // defined(GL_AMBIENT)
5466#if defined(GL_DIFFUSE)
5467 case GL_DIFFUSE:
5468#endif // defined(GL_DIFFUSE)
5469#if defined(GL_SPECULAR)
5470 case GL_SPECULAR:
5471#endif // defined(GL_SPECULAR)
5472#if defined(GL_EMISSION)
5473 case GL_EMISSION:
5474#endif // defined(GL_EMISSION)
5475 _needed = 4;
5476 break;
5477 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005478 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005479 break;
5480 }
5481 if (_remaining < _needed) {
5482 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005483 _exceptionType = "java/lang/IllegalArgumentException";
5484 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005485 goto exit;
5486 }
5487 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005488 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005489 params = params_base + offset;
5490
5491 glGetLightxv(
5492 (GLenum)light,
5493 (GLenum)pname,
5494 (GLfixed *)params
5495 );
5496
5497exit:
5498 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005499 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005500 _exception ? JNI_ABORT: 0);
5501 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005502 if (_exception) {
5503 jniThrowException(_env, _exceptionType, _exceptionMessage);
5504 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005505}
5506
5507/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5508static void
5509android_glGetLightxv__IILjava_nio_IntBuffer_2
5510 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5511 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005512 const char * _exceptionType = NULL;
5513 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005514 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005515 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005516 jint _remaining;
5517 GLfixed *params = (GLfixed *) 0;
5518
Romain Guy84cac202016-12-05 12:26:02 -08005519 if (!params_buf) {
5520 _exception = 1;
5521 _exceptionType = "java/lang/IllegalArgumentException";
5522 _exceptionMessage = "params == null";
5523 goto exit;
5524 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005525 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005526 int _needed;
5527 switch (pname) {
5528#if defined(GL_SPOT_EXPONENT)
5529 case GL_SPOT_EXPONENT:
5530#endif // defined(GL_SPOT_EXPONENT)
5531#if defined(GL_SPOT_CUTOFF)
5532 case GL_SPOT_CUTOFF:
5533#endif // defined(GL_SPOT_CUTOFF)
5534#if defined(GL_CONSTANT_ATTENUATION)
5535 case GL_CONSTANT_ATTENUATION:
5536#endif // defined(GL_CONSTANT_ATTENUATION)
5537#if defined(GL_LINEAR_ATTENUATION)
5538 case GL_LINEAR_ATTENUATION:
5539#endif // defined(GL_LINEAR_ATTENUATION)
5540#if defined(GL_QUADRATIC_ATTENUATION)
5541 case GL_QUADRATIC_ATTENUATION:
5542#endif // defined(GL_QUADRATIC_ATTENUATION)
5543 _needed = 1;
5544 break;
5545#if defined(GL_SPOT_DIRECTION)
5546 case GL_SPOT_DIRECTION:
5547#endif // defined(GL_SPOT_DIRECTION)
5548 _needed = 3;
5549 break;
5550#if defined(GL_AMBIENT)
5551 case GL_AMBIENT:
5552#endif // defined(GL_AMBIENT)
5553#if defined(GL_DIFFUSE)
5554 case GL_DIFFUSE:
5555#endif // defined(GL_DIFFUSE)
5556#if defined(GL_SPECULAR)
5557 case GL_SPECULAR:
5558#endif // defined(GL_SPECULAR)
5559#if defined(GL_EMISSION)
5560 case GL_EMISSION:
5561#endif // defined(GL_EMISSION)
5562 _needed = 4;
5563 break;
5564 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005565 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005566 break;
5567 }
5568 if (_remaining < _needed) {
5569 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005570 _exceptionType = "java/lang/IllegalArgumentException";
5571 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005572 goto exit;
5573 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005574 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005575 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005576 params = (GLfixed *) (_paramsBase + _bufferOffset);
5577 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005578 glGetLightxv(
5579 (GLenum)light,
5580 (GLenum)pname,
5581 (GLfixed *)params
5582 );
5583
5584exit:
5585 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005586 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005587 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005588 if (_exception) {
5589 jniThrowException(_env, _exceptionType, _exceptionMessage);
5590 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005591}
5592
5593/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5594static void
5595android_glGetMaterialfv__II_3FI
5596 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
5597 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005598 const char * _exceptionType = NULL;
5599 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005600 GLfloat *params_base = (GLfloat *) 0;
5601 jint _remaining;
5602 GLfloat *params = (GLfloat *) 0;
5603
5604 if (!params_ref) {
5605 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005606 _exceptionType = "java/lang/IllegalArgumentException";
5607 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005608 goto exit;
5609 }
5610 if (offset < 0) {
5611 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005612 _exceptionType = "java/lang/IllegalArgumentException";
5613 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005614 goto exit;
5615 }
5616 _remaining = _env->GetArrayLength(params_ref) - offset;
5617 int _needed;
5618 switch (pname) {
5619#if defined(GL_SHININESS)
5620 case GL_SHININESS:
5621#endif // defined(GL_SHININESS)
5622 _needed = 1;
5623 break;
5624#if defined(GL_AMBIENT)
5625 case GL_AMBIENT:
5626#endif // defined(GL_AMBIENT)
5627#if defined(GL_DIFFUSE)
5628 case GL_DIFFUSE:
5629#endif // defined(GL_DIFFUSE)
5630#if defined(GL_SPECULAR)
5631 case GL_SPECULAR:
5632#endif // defined(GL_SPECULAR)
5633#if defined(GL_EMISSION)
5634 case GL_EMISSION:
5635#endif // defined(GL_EMISSION)
5636#if defined(GL_AMBIENT_AND_DIFFUSE)
5637 case GL_AMBIENT_AND_DIFFUSE:
5638#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5639 _needed = 4;
5640 break;
5641 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005642 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005643 break;
5644 }
5645 if (_remaining < _needed) {
5646 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005647 _exceptionType = "java/lang/IllegalArgumentException";
5648 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005649 goto exit;
5650 }
5651 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005652 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005653 params = params_base + offset;
5654
5655 glGetMaterialfv(
5656 (GLenum)face,
5657 (GLenum)pname,
5658 (GLfloat *)params
5659 );
5660
5661exit:
5662 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005663 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005664 _exception ? JNI_ABORT: 0);
5665 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005666 if (_exception) {
5667 jniThrowException(_env, _exceptionType, _exceptionMessage);
5668 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005669}
5670
5671/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5672static void
5673android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
5674 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5675 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005676 const char * _exceptionType = NULL;
5677 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005678 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005679 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005680 jint _remaining;
5681 GLfloat *params = (GLfloat *) 0;
5682
Romain Guy84cac202016-12-05 12:26:02 -08005683 if (!params_buf) {
5684 _exception = 1;
5685 _exceptionType = "java/lang/IllegalArgumentException";
5686 _exceptionMessage = "params == null";
5687 goto exit;
5688 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005689 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005690 int _needed;
5691 switch (pname) {
5692#if defined(GL_SHININESS)
5693 case GL_SHININESS:
5694#endif // defined(GL_SHININESS)
5695 _needed = 1;
5696 break;
5697#if defined(GL_AMBIENT)
5698 case GL_AMBIENT:
5699#endif // defined(GL_AMBIENT)
5700#if defined(GL_DIFFUSE)
5701 case GL_DIFFUSE:
5702#endif // defined(GL_DIFFUSE)
5703#if defined(GL_SPECULAR)
5704 case GL_SPECULAR:
5705#endif // defined(GL_SPECULAR)
5706#if defined(GL_EMISSION)
5707 case GL_EMISSION:
5708#endif // defined(GL_EMISSION)
5709#if defined(GL_AMBIENT_AND_DIFFUSE)
5710 case GL_AMBIENT_AND_DIFFUSE:
5711#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5712 _needed = 4;
5713 break;
5714 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005715 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005716 break;
5717 }
5718 if (_remaining < _needed) {
5719 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005720 _exceptionType = "java/lang/IllegalArgumentException";
5721 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005722 goto exit;
5723 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005724 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005725 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005726 params = (GLfloat *) (_paramsBase + _bufferOffset);
5727 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005728 glGetMaterialfv(
5729 (GLenum)face,
5730 (GLenum)pname,
5731 (GLfloat *)params
5732 );
5733
5734exit:
5735 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005736 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005737 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005738 if (_exception) {
5739 jniThrowException(_env, _exceptionType, _exceptionMessage);
5740 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005741}
5742
5743/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5744static void
5745android_glGetMaterialxv__II_3II
5746 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
5747 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005748 const char * _exceptionType = NULL;
5749 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005750 GLfixed *params_base = (GLfixed *) 0;
5751 jint _remaining;
5752 GLfixed *params = (GLfixed *) 0;
5753
5754 if (!params_ref) {
5755 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005756 _exceptionType = "java/lang/IllegalArgumentException";
5757 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005758 goto exit;
5759 }
5760 if (offset < 0) {
5761 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005762 _exceptionType = "java/lang/IllegalArgumentException";
5763 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005764 goto exit;
5765 }
5766 _remaining = _env->GetArrayLength(params_ref) - offset;
5767 int _needed;
5768 switch (pname) {
5769#if defined(GL_SHININESS)
5770 case GL_SHININESS:
5771#endif // defined(GL_SHININESS)
5772 _needed = 1;
5773 break;
5774#if defined(GL_AMBIENT)
5775 case GL_AMBIENT:
5776#endif // defined(GL_AMBIENT)
5777#if defined(GL_DIFFUSE)
5778 case GL_DIFFUSE:
5779#endif // defined(GL_DIFFUSE)
5780#if defined(GL_SPECULAR)
5781 case GL_SPECULAR:
5782#endif // defined(GL_SPECULAR)
5783#if defined(GL_EMISSION)
5784 case GL_EMISSION:
5785#endif // defined(GL_EMISSION)
5786#if defined(GL_AMBIENT_AND_DIFFUSE)
5787 case GL_AMBIENT_AND_DIFFUSE:
5788#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5789 _needed = 4;
5790 break;
5791 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005792 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005793 break;
5794 }
5795 if (_remaining < _needed) {
5796 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005797 _exceptionType = "java/lang/IllegalArgumentException";
5798 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005799 goto exit;
5800 }
5801 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005802 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005803 params = params_base + offset;
5804
5805 glGetMaterialxv(
5806 (GLenum)face,
5807 (GLenum)pname,
5808 (GLfixed *)params
5809 );
5810
5811exit:
5812 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005813 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005814 _exception ? JNI_ABORT: 0);
5815 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005816 if (_exception) {
5817 jniThrowException(_env, _exceptionType, _exceptionMessage);
5818 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005819}
5820
5821/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5822static void
5823android_glGetMaterialxv__IILjava_nio_IntBuffer_2
5824 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5825 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005826 const char * _exceptionType = NULL;
5827 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005828 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005829 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005830 jint _remaining;
5831 GLfixed *params = (GLfixed *) 0;
5832
Romain Guy84cac202016-12-05 12:26:02 -08005833 if (!params_buf) {
5834 _exception = 1;
5835 _exceptionType = "java/lang/IllegalArgumentException";
5836 _exceptionMessage = "params == null";
5837 goto exit;
5838 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005839 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005840 int _needed;
5841 switch (pname) {
5842#if defined(GL_SHININESS)
5843 case GL_SHININESS:
5844#endif // defined(GL_SHININESS)
5845 _needed = 1;
5846 break;
5847#if defined(GL_AMBIENT)
5848 case GL_AMBIENT:
5849#endif // defined(GL_AMBIENT)
5850#if defined(GL_DIFFUSE)
5851 case GL_DIFFUSE:
5852#endif // defined(GL_DIFFUSE)
5853#if defined(GL_SPECULAR)
5854 case GL_SPECULAR:
5855#endif // defined(GL_SPECULAR)
5856#if defined(GL_EMISSION)
5857 case GL_EMISSION:
5858#endif // defined(GL_EMISSION)
5859#if defined(GL_AMBIENT_AND_DIFFUSE)
5860 case GL_AMBIENT_AND_DIFFUSE:
5861#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5862 _needed = 4;
5863 break;
5864 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005865 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005866 break;
5867 }
5868 if (_remaining < _needed) {
5869 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005870 _exceptionType = "java/lang/IllegalArgumentException";
5871 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005872 goto exit;
5873 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005874 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005875 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005876 params = (GLfixed *) (_paramsBase + _bufferOffset);
5877 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005878 glGetMaterialxv(
5879 (GLenum)face,
5880 (GLenum)pname,
5881 (GLfixed *)params
5882 );
5883
5884exit:
5885 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005886 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005887 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005888 if (_exception) {
5889 jniThrowException(_env, _exceptionType, _exceptionMessage);
5890 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005891}
5892
5893/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5894static void
5895android_glGetTexEnviv__II_3II
5896 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
5897 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005898 const char * _exceptionType = NULL;
5899 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005900 GLint *params_base = (GLint *) 0;
5901 jint _remaining;
5902 GLint *params = (GLint *) 0;
5903
5904 if (!params_ref) {
5905 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005906 _exceptionType = "java/lang/IllegalArgumentException";
5907 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005908 goto exit;
5909 }
5910 if (offset < 0) {
5911 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005912 _exceptionType = "java/lang/IllegalArgumentException";
5913 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005914 goto exit;
5915 }
5916 _remaining = _env->GetArrayLength(params_ref) - offset;
5917 int _needed;
5918 switch (pname) {
5919#if defined(GL_TEXTURE_ENV_MODE)
5920 case GL_TEXTURE_ENV_MODE:
5921#endif // defined(GL_TEXTURE_ENV_MODE)
5922#if defined(GL_COMBINE_RGB)
5923 case GL_COMBINE_RGB:
5924#endif // defined(GL_COMBINE_RGB)
5925#if defined(GL_COMBINE_ALPHA)
5926 case GL_COMBINE_ALPHA:
5927#endif // defined(GL_COMBINE_ALPHA)
5928 _needed = 1;
5929 break;
5930#if defined(GL_TEXTURE_ENV_COLOR)
5931 case GL_TEXTURE_ENV_COLOR:
5932#endif // defined(GL_TEXTURE_ENV_COLOR)
5933 _needed = 4;
5934 break;
5935 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005936 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005937 break;
5938 }
5939 if (_remaining < _needed) {
5940 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005941 _exceptionType = "java/lang/IllegalArgumentException";
5942 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005943 goto exit;
5944 }
5945 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005946 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005947 params = params_base + offset;
5948
5949 glGetTexEnviv(
5950 (GLenum)env,
5951 (GLenum)pname,
5952 (GLint *)params
5953 );
5954
5955exit:
5956 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005957 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005958 _exception ? JNI_ABORT: 0);
5959 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005960 if (_exception) {
5961 jniThrowException(_env, _exceptionType, _exceptionMessage);
5962 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005963}
5964
5965/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5966static void
5967android_glGetTexEnviv__IILjava_nio_IntBuffer_2
5968 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
5969 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005970 const char * _exceptionType = NULL;
5971 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005972 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005973 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005974 jint _remaining;
5975 GLint *params = (GLint *) 0;
5976
Romain Guy84cac202016-12-05 12:26:02 -08005977 if (!params_buf) {
5978 _exception = 1;
5979 _exceptionType = "java/lang/IllegalArgumentException";
5980 _exceptionMessage = "params == null";
5981 goto exit;
5982 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005983 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005984 int _needed;
5985 switch (pname) {
5986#if defined(GL_TEXTURE_ENV_MODE)
5987 case GL_TEXTURE_ENV_MODE:
5988#endif // defined(GL_TEXTURE_ENV_MODE)
5989#if defined(GL_COMBINE_RGB)
5990 case GL_COMBINE_RGB:
5991#endif // defined(GL_COMBINE_RGB)
5992#if defined(GL_COMBINE_ALPHA)
5993 case GL_COMBINE_ALPHA:
5994#endif // defined(GL_COMBINE_ALPHA)
5995 _needed = 1;
5996 break;
5997#if defined(GL_TEXTURE_ENV_COLOR)
5998 case GL_TEXTURE_ENV_COLOR:
5999#endif // defined(GL_TEXTURE_ENV_COLOR)
6000 _needed = 4;
6001 break;
6002 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006003 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006004 break;
6005 }
6006 if (_remaining < _needed) {
6007 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006008 _exceptionType = "java/lang/IllegalArgumentException";
6009 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006010 goto exit;
6011 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006012 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006013 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006014 params = (GLint *) (_paramsBase + _bufferOffset);
6015 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006016 glGetTexEnviv(
6017 (GLenum)env,
6018 (GLenum)pname,
6019 (GLint *)params
6020 );
6021
6022exit:
6023 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006024 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006025 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006026 if (_exception) {
6027 jniThrowException(_env, _exceptionType, _exceptionMessage);
6028 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006029}
6030
6031/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
6032static void
6033android_glGetTexEnvxv__II_3II
6034 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
6035 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006036 const char * _exceptionType = NULL;
6037 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006038 GLfixed *params_base = (GLfixed *) 0;
6039 jint _remaining;
6040 GLfixed *params = (GLfixed *) 0;
6041
6042 if (!params_ref) {
6043 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006044 _exceptionType = "java/lang/IllegalArgumentException";
6045 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006046 goto exit;
6047 }
6048 if (offset < 0) {
6049 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006050 _exceptionType = "java/lang/IllegalArgumentException";
6051 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006052 goto exit;
6053 }
6054 _remaining = _env->GetArrayLength(params_ref) - offset;
6055 int _needed;
6056 switch (pname) {
6057#if defined(GL_TEXTURE_ENV_MODE)
6058 case GL_TEXTURE_ENV_MODE:
6059#endif // defined(GL_TEXTURE_ENV_MODE)
6060#if defined(GL_COMBINE_RGB)
6061 case GL_COMBINE_RGB:
6062#endif // defined(GL_COMBINE_RGB)
6063#if defined(GL_COMBINE_ALPHA)
6064 case GL_COMBINE_ALPHA:
6065#endif // defined(GL_COMBINE_ALPHA)
6066 _needed = 1;
6067 break;
6068#if defined(GL_TEXTURE_ENV_COLOR)
6069 case GL_TEXTURE_ENV_COLOR:
6070#endif // defined(GL_TEXTURE_ENV_COLOR)
6071 _needed = 4;
6072 break;
6073 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006074 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006075 break;
6076 }
6077 if (_remaining < _needed) {
6078 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006079 _exceptionType = "java/lang/IllegalArgumentException";
6080 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006081 goto exit;
6082 }
6083 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006084 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006085 params = params_base + offset;
6086
6087 glGetTexEnvxv(
6088 (GLenum)env,
6089 (GLenum)pname,
6090 (GLfixed *)params
6091 );
6092
6093exit:
6094 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006095 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006096 _exception ? JNI_ABORT: 0);
6097 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006098 if (_exception) {
6099 jniThrowException(_env, _exceptionType, _exceptionMessage);
6100 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006101}
6102
6103/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
6104static void
6105android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
6106 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
6107 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006108 const char * _exceptionType = NULL;
6109 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006110 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006111 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006112 jint _remaining;
6113 GLfixed *params = (GLfixed *) 0;
6114
Romain Guy84cac202016-12-05 12:26:02 -08006115 if (!params_buf) {
6116 _exception = 1;
6117 _exceptionType = "java/lang/IllegalArgumentException";
6118 _exceptionMessage = "params == null";
6119 goto exit;
6120 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006121 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006122 int _needed;
6123 switch (pname) {
6124#if defined(GL_TEXTURE_ENV_MODE)
6125 case GL_TEXTURE_ENV_MODE:
6126#endif // defined(GL_TEXTURE_ENV_MODE)
6127#if defined(GL_COMBINE_RGB)
6128 case GL_COMBINE_RGB:
6129#endif // defined(GL_COMBINE_RGB)
6130#if defined(GL_COMBINE_ALPHA)
6131 case GL_COMBINE_ALPHA:
6132#endif // defined(GL_COMBINE_ALPHA)
6133 _needed = 1;
6134 break;
6135#if defined(GL_TEXTURE_ENV_COLOR)
6136 case GL_TEXTURE_ENV_COLOR:
6137#endif // defined(GL_TEXTURE_ENV_COLOR)
6138 _needed = 4;
6139 break;
6140 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006141 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006142 break;
6143 }
6144 if (_remaining < _needed) {
6145 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006146 _exceptionType = "java/lang/IllegalArgumentException";
6147 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006148 goto exit;
6149 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006150 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006151 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006152 params = (GLfixed *) (_paramsBase + _bufferOffset);
6153 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006154 glGetTexEnvxv(
6155 (GLenum)env,
6156 (GLenum)pname,
6157 (GLfixed *)params
6158 );
6159
6160exit:
6161 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006162 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006163 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006164 if (_exception) {
6165 jniThrowException(_env, _exceptionType, _exceptionMessage);
6166 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006167}
6168
6169/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
6170static void
6171android_glGetTexParameterfv__II_3FI
6172 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
6173 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006174 const char * _exceptionType = NULL;
6175 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006176 GLfloat *params_base = (GLfloat *) 0;
6177 jint _remaining;
6178 GLfloat *params = (GLfloat *) 0;
6179
6180 if (!params_ref) {
6181 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006182 _exceptionType = "java/lang/IllegalArgumentException";
6183 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006184 goto exit;
6185 }
6186 if (offset < 0) {
6187 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006188 _exceptionType = "java/lang/IllegalArgumentException";
6189 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006190 goto exit;
6191 }
6192 _remaining = _env->GetArrayLength(params_ref) - offset;
6193 if (_remaining < 1) {
6194 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006195 _exceptionType = "java/lang/IllegalArgumentException";
6196 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006197 goto exit;
6198 }
6199 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006200 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006201 params = params_base + offset;
6202
6203 glGetTexParameterfv(
6204 (GLenum)target,
6205 (GLenum)pname,
6206 (GLfloat *)params
6207 );
6208
6209exit:
6210 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006211 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006212 _exception ? JNI_ABORT: 0);
6213 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006214 if (_exception) {
6215 jniThrowException(_env, _exceptionType, _exceptionMessage);
6216 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006217}
6218
6219/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
6220static void
6221android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
6222 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6223 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006224 const char * _exceptionType = NULL;
6225 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006226 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006227 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006228 jint _remaining;
6229 GLfloat *params = (GLfloat *) 0;
6230
Romain Guy84cac202016-12-05 12:26:02 -08006231 if (!params_buf) {
6232 _exception = 1;
6233 _exceptionType = "java/lang/IllegalArgumentException";
6234 _exceptionMessage = "params == null";
6235 goto exit;
6236 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006237 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006238 if (_remaining < 1) {
6239 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006240 _exceptionType = "java/lang/IllegalArgumentException";
6241 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006242 goto exit;
6243 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006244 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006245 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006246 params = (GLfloat *) (_paramsBase + _bufferOffset);
6247 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006248 glGetTexParameterfv(
6249 (GLenum)target,
6250 (GLenum)pname,
6251 (GLfloat *)params
6252 );
6253
6254exit:
6255 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006256 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006257 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006258 if (_exception) {
6259 jniThrowException(_env, _exceptionType, _exceptionMessage);
6260 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006261}
6262
6263/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
6264static void
6265android_glGetTexParameteriv__II_3II
6266 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6267 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006268 const char * _exceptionType = NULL;
6269 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006270 GLint *params_base = (GLint *) 0;
6271 jint _remaining;
6272 GLint *params = (GLint *) 0;
6273
6274 if (!params_ref) {
6275 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006276 _exceptionType = "java/lang/IllegalArgumentException";
6277 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006278 goto exit;
6279 }
6280 if (offset < 0) {
6281 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006282 _exceptionType = "java/lang/IllegalArgumentException";
6283 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006284 goto exit;
6285 }
6286 _remaining = _env->GetArrayLength(params_ref) - offset;
6287 if (_remaining < 1) {
6288 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006289 _exceptionType = "java/lang/IllegalArgumentException";
6290 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006291 goto exit;
6292 }
6293 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006294 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006295 params = params_base + offset;
6296
6297 glGetTexParameteriv(
6298 (GLenum)target,
6299 (GLenum)pname,
6300 (GLint *)params
6301 );
6302
6303exit:
6304 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006305 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006306 _exception ? JNI_ABORT: 0);
6307 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006308 if (_exception) {
6309 jniThrowException(_env, _exceptionType, _exceptionMessage);
6310 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006311}
6312
6313/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
6314static void
6315android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
6316 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6317 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006318 const char * _exceptionType = NULL;
6319 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006320 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006321 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006322 jint _remaining;
6323 GLint *params = (GLint *) 0;
6324
Romain Guy84cac202016-12-05 12:26:02 -08006325 if (!params_buf) {
6326 _exception = 1;
6327 _exceptionType = "java/lang/IllegalArgumentException";
6328 _exceptionMessage = "params == null";
6329 goto exit;
6330 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006331 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006332 if (_remaining < 1) {
6333 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006334 _exceptionType = "java/lang/IllegalArgumentException";
6335 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006336 goto exit;
6337 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006338 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006339 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006340 params = (GLint *) (_paramsBase + _bufferOffset);
6341 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006342 glGetTexParameteriv(
6343 (GLenum)target,
6344 (GLenum)pname,
6345 (GLint *)params
6346 );
6347
6348exit:
6349 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006350 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006351 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006352 if (_exception) {
6353 jniThrowException(_env, _exceptionType, _exceptionMessage);
6354 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006355}
6356
6357/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6358static void
6359android_glGetTexParameterxv__II_3II
6360 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6361 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006362 const char * _exceptionType = NULL;
6363 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006364 GLfixed *params_base = (GLfixed *) 0;
6365 jint _remaining;
6366 GLfixed *params = (GLfixed *) 0;
6367
6368 if (!params_ref) {
6369 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006370 _exceptionType = "java/lang/IllegalArgumentException";
6371 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006372 goto exit;
6373 }
6374 if (offset < 0) {
6375 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006376 _exceptionType = "java/lang/IllegalArgumentException";
6377 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006378 goto exit;
6379 }
6380 _remaining = _env->GetArrayLength(params_ref) - offset;
6381 if (_remaining < 1) {
6382 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006383 _exceptionType = "java/lang/IllegalArgumentException";
6384 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006385 goto exit;
6386 }
6387 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006388 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006389 params = params_base + offset;
6390
6391 glGetTexParameterxv(
6392 (GLenum)target,
6393 (GLenum)pname,
6394 (GLfixed *)params
6395 );
6396
6397exit:
6398 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006399 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006400 _exception ? JNI_ABORT: 0);
6401 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006402 if (_exception) {
6403 jniThrowException(_env, _exceptionType, _exceptionMessage);
6404 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006405}
6406
6407/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6408static void
6409android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
6410 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6411 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006412 const char * _exceptionType = NULL;
6413 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006414 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006415 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006416 jint _remaining;
6417 GLfixed *params = (GLfixed *) 0;
6418
Romain Guy84cac202016-12-05 12:26:02 -08006419 if (!params_buf) {
6420 _exception = 1;
6421 _exceptionType = "java/lang/IllegalArgumentException";
6422 _exceptionMessage = "params == null";
6423 goto exit;
6424 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006425 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006426 if (_remaining < 1) {
6427 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006428 _exceptionType = "java/lang/IllegalArgumentException";
6429 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006430 goto exit;
6431 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006432 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006433 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006434 params = (GLfixed *) (_paramsBase + _bufferOffset);
6435 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006436 glGetTexParameterxv(
6437 (GLenum)target,
6438 (GLenum)pname,
6439 (GLfixed *)params
6440 );
6441
6442exit:
6443 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006444 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006445 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006446 if (_exception) {
6447 jniThrowException(_env, _exceptionType, _exceptionMessage);
6448 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006449}
6450
6451/* GLboolean glIsBuffer ( GLuint buffer ) */
6452static jboolean
6453android_glIsBuffer__I
6454 (JNIEnv *_env, jobject _this, jint buffer) {
6455 GLboolean _returnValue;
6456 _returnValue = glIsBuffer(
6457 (GLuint)buffer
6458 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006459 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006460}
6461
6462/* GLboolean glIsEnabled ( GLenum cap ) */
6463static jboolean
6464android_glIsEnabled__I
6465 (JNIEnv *_env, jobject _this, jint cap) {
6466 GLboolean _returnValue;
6467 _returnValue = glIsEnabled(
6468 (GLenum)cap
6469 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006470 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006471}
6472
6473/* GLboolean glIsTexture ( GLuint texture ) */
6474static jboolean
6475android_glIsTexture__I
6476 (JNIEnv *_env, jobject _this, jint texture) {
6477 GLboolean _returnValue;
6478 _returnValue = glIsTexture(
6479 (GLuint)texture
6480 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006481 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006482}
6483
6484/* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */
6485static void
6486android_glNormalPointer__III
6487 (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) {
6488 glNormalPointer(
6489 (GLenum)type,
6490 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00006491 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006492 );
6493}
6494
6495/* void glPointParameterf ( GLenum pname, GLfloat param ) */
6496static void
6497android_glPointParameterf__IF
6498 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
6499 glPointParameterf(
6500 (GLenum)pname,
6501 (GLfloat)param
6502 );
6503}
6504
6505/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6506static void
6507android_glPointParameterfv__I_3FI
6508 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006509 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006510 const char * _exceptionType = NULL;
6511 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006512 GLfloat *params_base = (GLfloat *) 0;
6513 jint _remaining;
6514 GLfloat *params = (GLfloat *) 0;
6515
6516 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006517 _exception = 1;
6518 _exceptionType = "java/lang/IllegalArgumentException";
6519 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006520 goto exit;
6521 }
6522 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006523 _exception = 1;
6524 _exceptionType = "java/lang/IllegalArgumentException";
6525 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006526 goto exit;
6527 }
6528 _remaining = _env->GetArrayLength(params_ref) - offset;
6529 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006530 _exception = 1;
6531 _exceptionType = "java/lang/IllegalArgumentException";
6532 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006533 goto exit;
6534 }
6535 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006536 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006537 params = params_base + offset;
6538
6539 glPointParameterfv(
6540 (GLenum)pname,
6541 (GLfloat *)params
6542 );
6543
6544exit:
6545 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006546 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006547 JNI_ABORT);
6548 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006549 if (_exception) {
6550 jniThrowException(_env, _exceptionType, _exceptionMessage);
6551 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006552}
6553
6554/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6555static void
6556android_glPointParameterfv__ILjava_nio_FloatBuffer_2
6557 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006558 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006559 const char * _exceptionType = NULL;
6560 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006561 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006562 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006563 jint _remaining;
6564 GLfloat *params = (GLfloat *) 0;
6565
Romain Guy84cac202016-12-05 12:26:02 -08006566 if (!params_buf) {
6567 _exception = 1;
6568 _exceptionType = "java/lang/IllegalArgumentException";
6569 _exceptionMessage = "params == null";
6570 goto exit;
6571 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006572 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006573 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006574 _exception = 1;
6575 _exceptionType = "java/lang/IllegalArgumentException";
6576 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006577 goto exit;
6578 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006579 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006580 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006581 params = (GLfloat *) (_paramsBase + _bufferOffset);
6582 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006583 glPointParameterfv(
6584 (GLenum)pname,
6585 (GLfloat *)params
6586 );
6587
6588exit:
6589 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006590 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006591 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006592 if (_exception) {
6593 jniThrowException(_env, _exceptionType, _exceptionMessage);
6594 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006595}
6596
6597/* void glPointParameterx ( GLenum pname, GLfixed param ) */
6598static void
6599android_glPointParameterx__II
6600 (JNIEnv *_env, jobject _this, jint pname, jint param) {
6601 glPointParameterx(
6602 (GLenum)pname,
6603 (GLfixed)param
6604 );
6605}
6606
6607/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6608static void
6609android_glPointParameterxv__I_3II
6610 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006611 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006612 const char * _exceptionType = NULL;
6613 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006614 GLfixed *params_base = (GLfixed *) 0;
6615 jint _remaining;
6616 GLfixed *params = (GLfixed *) 0;
6617
6618 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006619 _exception = 1;
6620 _exceptionType = "java/lang/IllegalArgumentException";
6621 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006622 goto exit;
6623 }
6624 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006625 _exception = 1;
6626 _exceptionType = "java/lang/IllegalArgumentException";
6627 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006628 goto exit;
6629 }
6630 _remaining = _env->GetArrayLength(params_ref) - offset;
6631 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006632 _exception = 1;
6633 _exceptionType = "java/lang/IllegalArgumentException";
6634 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006635 goto exit;
6636 }
6637 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006638 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006639 params = params_base + offset;
6640
6641 glPointParameterxv(
6642 (GLenum)pname,
6643 (GLfixed *)params
6644 );
6645
6646exit:
6647 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006648 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006649 JNI_ABORT);
6650 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006651 if (_exception) {
6652 jniThrowException(_env, _exceptionType, _exceptionMessage);
6653 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006654}
6655
6656/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6657static void
6658android_glPointParameterxv__ILjava_nio_IntBuffer_2
6659 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006660 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006661 const char * _exceptionType = NULL;
6662 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006663 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006664 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006665 jint _remaining;
6666 GLfixed *params = (GLfixed *) 0;
6667
Romain Guy84cac202016-12-05 12:26:02 -08006668 if (!params_buf) {
6669 _exception = 1;
6670 _exceptionType = "java/lang/IllegalArgumentException";
6671 _exceptionMessage = "params == null";
6672 goto exit;
6673 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006674 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006675 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006676 _exception = 1;
6677 _exceptionType = "java/lang/IllegalArgumentException";
6678 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006679 goto exit;
6680 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006681 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006682 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006683 params = (GLfixed *) (_paramsBase + _bufferOffset);
6684 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006685 glPointParameterxv(
6686 (GLenum)pname,
6687 (GLfixed *)params
6688 );
6689
6690exit:
6691 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006692 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006693 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006694 if (_exception) {
6695 jniThrowException(_env, _exceptionType, _exceptionMessage);
6696 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006697}
6698
6699/* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
6700static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08006701android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
6702 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08006703 jint _exception = 0;
6704 const char * _exceptionType = NULL;
6705 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006706 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006707 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006708 jint _remaining;
6709 GLvoid *pointer = (GLvoid *) 0;
6710
Jack Palevichbe6eac82009-12-08 15:43:51 +08006711 if (pointer_buf) {
6712 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
6713 if ( ! pointer ) {
6714 return;
6715 }
6716 }
6717 glPointSizePointerOESBounds(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006718 (GLenum)type,
6719 (GLsizei)stride,
Jack Palevichbe6eac82009-12-08 15:43:51 +08006720 (GLvoid *)pointer,
6721 (GLsizei)remaining
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006722 );
Romain Guy84cac202016-12-05 12:26:02 -08006723 if (_exception) {
6724 jniThrowException(_env, _exceptionType, _exceptionMessage);
6725 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006726}
6727
6728/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
6729static void
6730android_glTexCoordPointer__IIII
6731 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
6732 glTexCoordPointer(
6733 (GLint)size,
6734 (GLenum)type,
6735 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00006736 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006737 );
6738}
6739
6740/* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */
6741static void
6742android_glTexEnvi__III
6743 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6744 glTexEnvi(
6745 (GLenum)target,
6746 (GLenum)pname,
6747 (GLint)param
6748 );
6749}
6750
6751/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6752static void
6753android_glTexEnviv__II_3II
6754 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006755 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006756 const char * _exceptionType = NULL;
6757 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006758 GLint *params_base = (GLint *) 0;
6759 jint _remaining;
6760 GLint *params = (GLint *) 0;
6761
6762 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006763 _exception = 1;
6764 _exceptionType = "java/lang/IllegalArgumentException";
6765 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006766 goto exit;
6767 }
6768 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006769 _exception = 1;
6770 _exceptionType = "java/lang/IllegalArgumentException";
6771 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006772 goto exit;
6773 }
6774 _remaining = _env->GetArrayLength(params_ref) - offset;
6775 int _needed;
6776 switch (pname) {
6777#if defined(GL_TEXTURE_ENV_MODE)
6778 case GL_TEXTURE_ENV_MODE:
6779#endif // defined(GL_TEXTURE_ENV_MODE)
6780#if defined(GL_COMBINE_RGB)
6781 case GL_COMBINE_RGB:
6782#endif // defined(GL_COMBINE_RGB)
6783#if defined(GL_COMBINE_ALPHA)
6784 case GL_COMBINE_ALPHA:
6785#endif // defined(GL_COMBINE_ALPHA)
6786 _needed = 1;
6787 break;
6788#if defined(GL_TEXTURE_ENV_COLOR)
6789 case GL_TEXTURE_ENV_COLOR:
6790#endif // defined(GL_TEXTURE_ENV_COLOR)
6791 _needed = 4;
6792 break;
6793 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006794 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006795 break;
6796 }
6797 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006798 _exception = 1;
6799 _exceptionType = "java/lang/IllegalArgumentException";
6800 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006801 goto exit;
6802 }
6803 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006804 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006805 params = params_base + offset;
6806
6807 glTexEnviv(
6808 (GLenum)target,
6809 (GLenum)pname,
6810 (GLint *)params
6811 );
6812
6813exit:
6814 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006815 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006816 JNI_ABORT);
6817 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006818 if (_exception) {
6819 jniThrowException(_env, _exceptionType, _exceptionMessage);
6820 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006821}
6822
6823/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6824static void
6825android_glTexEnviv__IILjava_nio_IntBuffer_2
6826 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006827 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006828 const char * _exceptionType = NULL;
6829 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006830 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006831 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006832 jint _remaining;
6833 GLint *params = (GLint *) 0;
6834
Romain Guy84cac202016-12-05 12:26:02 -08006835 if (!params_buf) {
6836 _exception = 1;
6837 _exceptionType = "java/lang/IllegalArgumentException";
6838 _exceptionMessage = "params == null";
6839 goto exit;
6840 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006841 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006842 int _needed;
6843 switch (pname) {
6844#if defined(GL_TEXTURE_ENV_MODE)
6845 case GL_TEXTURE_ENV_MODE:
6846#endif // defined(GL_TEXTURE_ENV_MODE)
6847#if defined(GL_COMBINE_RGB)
6848 case GL_COMBINE_RGB:
6849#endif // defined(GL_COMBINE_RGB)
6850#if defined(GL_COMBINE_ALPHA)
6851 case GL_COMBINE_ALPHA:
6852#endif // defined(GL_COMBINE_ALPHA)
6853 _needed = 1;
6854 break;
6855#if defined(GL_TEXTURE_ENV_COLOR)
6856 case GL_TEXTURE_ENV_COLOR:
6857#endif // defined(GL_TEXTURE_ENV_COLOR)
6858 _needed = 4;
6859 break;
6860 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006861 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006862 break;
6863 }
6864 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006865 _exception = 1;
6866 _exceptionType = "java/lang/IllegalArgumentException";
6867 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006868 goto exit;
6869 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006870 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006871 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006872 params = (GLint *) (_paramsBase + _bufferOffset);
6873 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006874 glTexEnviv(
6875 (GLenum)target,
6876 (GLenum)pname,
6877 (GLint *)params
6878 );
6879
6880exit:
6881 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006882 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006883 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006884 if (_exception) {
6885 jniThrowException(_env, _exceptionType, _exceptionMessage);
6886 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006887}
6888
6889/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6890static void
6891android_glTexParameterfv__II_3FI
6892 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006893 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006894 const char * _exceptionType = NULL;
6895 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006896 GLfloat *params_base = (GLfloat *) 0;
6897 jint _remaining;
6898 GLfloat *params = (GLfloat *) 0;
6899
6900 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006901 _exception = 1;
6902 _exceptionType = "java/lang/IllegalArgumentException";
6903 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006904 goto exit;
6905 }
6906 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006907 _exception = 1;
6908 _exceptionType = "java/lang/IllegalArgumentException";
6909 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006910 goto exit;
6911 }
6912 _remaining = _env->GetArrayLength(params_ref) - offset;
6913 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006914 _exception = 1;
6915 _exceptionType = "java/lang/IllegalArgumentException";
6916 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006917 goto exit;
6918 }
6919 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006920 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006921 params = params_base + offset;
6922
6923 glTexParameterfv(
6924 (GLenum)target,
6925 (GLenum)pname,
6926 (GLfloat *)params
6927 );
6928
6929exit:
6930 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006931 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006932 JNI_ABORT);
6933 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006934 if (_exception) {
6935 jniThrowException(_env, _exceptionType, _exceptionMessage);
6936 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006937}
6938
6939/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6940static void
6941android_glTexParameterfv__IILjava_nio_FloatBuffer_2
6942 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006943 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006944 const char * _exceptionType = NULL;
6945 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006946 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006947 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006948 jint _remaining;
6949 GLfloat *params = (GLfloat *) 0;
6950
Romain Guy84cac202016-12-05 12:26:02 -08006951 if (!params_buf) {
6952 _exception = 1;
6953 _exceptionType = "java/lang/IllegalArgumentException";
6954 _exceptionMessage = "params == null";
6955 goto exit;
6956 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006957 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006958 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006959 _exception = 1;
6960 _exceptionType = "java/lang/IllegalArgumentException";
6961 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006962 goto exit;
6963 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006964 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006965 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006966 params = (GLfloat *) (_paramsBase + _bufferOffset);
6967 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006968 glTexParameterfv(
6969 (GLenum)target,
6970 (GLenum)pname,
6971 (GLfloat *)params
6972 );
6973
6974exit:
6975 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006976 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006977 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006978 if (_exception) {
6979 jniThrowException(_env, _exceptionType, _exceptionMessage);
6980 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006981}
6982
6983/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */
6984static void
6985android_glTexParameteri__III
6986 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6987 glTexParameteri(
6988 (GLenum)target,
6989 (GLenum)pname,
6990 (GLint)param
6991 );
6992}
6993
6994/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
6995static void
6996android_glTexParameteriv__II_3II
6997 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006998 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006999 const char * _exceptionType = NULL;
7000 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007001 GLint *params_base = (GLint *) 0;
7002 jint _remaining;
7003 GLint *params = (GLint *) 0;
7004
7005 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007006 _exception = 1;
7007 _exceptionType = "java/lang/IllegalArgumentException";
7008 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007009 goto exit;
7010 }
7011 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007012 _exception = 1;
7013 _exceptionType = "java/lang/IllegalArgumentException";
7014 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007015 goto exit;
7016 }
7017 _remaining = _env->GetArrayLength(params_ref) - offset;
7018 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007019 _exception = 1;
7020 _exceptionType = "java/lang/IllegalArgumentException";
7021 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007022 goto exit;
7023 }
7024 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007025 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007026 params = params_base + offset;
7027
7028 glTexParameteriv(
7029 (GLenum)target,
7030 (GLenum)pname,
7031 (GLint *)params
7032 );
7033
7034exit:
7035 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007036 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007037 JNI_ABORT);
7038 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007039 if (_exception) {
7040 jniThrowException(_env, _exceptionType, _exceptionMessage);
7041 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007042}
7043
7044/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
7045static void
7046android_glTexParameteriv__IILjava_nio_IntBuffer_2
7047 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007048 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007049 const char * _exceptionType = NULL;
7050 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007051 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007052 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007053 jint _remaining;
7054 GLint *params = (GLint *) 0;
7055
Romain Guy84cac202016-12-05 12:26:02 -08007056 if (!params_buf) {
7057 _exception = 1;
7058 _exceptionType = "java/lang/IllegalArgumentException";
7059 _exceptionMessage = "params == null";
7060 goto exit;
7061 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007062 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007063 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007064 _exception = 1;
7065 _exceptionType = "java/lang/IllegalArgumentException";
7066 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007067 goto exit;
7068 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007069 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007070 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007071 params = (GLint *) (_paramsBase + _bufferOffset);
7072 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007073 glTexParameteriv(
7074 (GLenum)target,
7075 (GLenum)pname,
7076 (GLint *)params
7077 );
7078
7079exit:
7080 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007081 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007082 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007083 if (_exception) {
7084 jniThrowException(_env, _exceptionType, _exceptionMessage);
7085 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007086}
7087
7088/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
7089static void
7090android_glTexParameterxv__II_3II
7091 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007092 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007093 const char * _exceptionType = NULL;
7094 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007095 GLfixed *params_base = (GLfixed *) 0;
7096 jint _remaining;
7097 GLfixed *params = (GLfixed *) 0;
7098
7099 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007100 _exception = 1;
7101 _exceptionType = "java/lang/IllegalArgumentException";
7102 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007103 goto exit;
7104 }
7105 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007106 _exception = 1;
7107 _exceptionType = "java/lang/IllegalArgumentException";
7108 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007109 goto exit;
7110 }
7111 _remaining = _env->GetArrayLength(params_ref) - offset;
7112 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007113 _exception = 1;
7114 _exceptionType = "java/lang/IllegalArgumentException";
7115 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007116 goto exit;
7117 }
7118 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007119 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007120 params = params_base + offset;
7121
7122 glTexParameterxv(
7123 (GLenum)target,
7124 (GLenum)pname,
7125 (GLfixed *)params
7126 );
7127
7128exit:
7129 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007130 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007131 JNI_ABORT);
7132 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007133 if (_exception) {
7134 jniThrowException(_env, _exceptionType, _exceptionMessage);
7135 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007136}
7137
7138/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
7139static void
7140android_glTexParameterxv__IILjava_nio_IntBuffer_2
7141 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007142 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007143 const char * _exceptionType = NULL;
7144 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007145 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007146 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007147 jint _remaining;
7148 GLfixed *params = (GLfixed *) 0;
7149
Romain Guy84cac202016-12-05 12:26:02 -08007150 if (!params_buf) {
7151 _exception = 1;
7152 _exceptionType = "java/lang/IllegalArgumentException";
7153 _exceptionMessage = "params == null";
7154 goto exit;
7155 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007156 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007157 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007158 _exception = 1;
7159 _exceptionType = "java/lang/IllegalArgumentException";
7160 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007161 goto exit;
7162 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007163 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007164 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007165 params = (GLfixed *) (_paramsBase + _bufferOffset);
7166 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007167 glTexParameterxv(
7168 (GLenum)target,
7169 (GLenum)pname,
7170 (GLfixed *)params
7171 );
7172
7173exit:
7174 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007175 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007176 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007177 if (_exception) {
7178 jniThrowException(_env, _exceptionType, _exceptionMessage);
7179 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007180}
7181
7182/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7183static void
7184android_glVertexPointer__IIII
7185 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
7186 glVertexPointer(
7187 (GLint)size,
7188 (GLenum)type,
7189 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007190 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007191 );
7192}
7193
7194/* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */
7195static void
7196android_glCurrentPaletteMatrixOES__I
7197 (JNIEnv *_env, jobject _this, jint matrixpaletteindex) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007198 glCurrentPaletteMatrixOES(
7199 (GLuint)matrixpaletteindex
7200 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007201}
7202
7203/* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */
7204static void
7205android_glDrawTexfOES__FFFFF
7206 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) {
7207 glDrawTexfOES(
7208 (GLfloat)x,
7209 (GLfloat)y,
7210 (GLfloat)z,
7211 (GLfloat)width,
7212 (GLfloat)height
7213 );
7214}
7215
7216/* void glDrawTexfvOES ( const GLfloat *coords ) */
7217static void
7218android_glDrawTexfvOES___3FI
7219 (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007220 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007221 const char * _exceptionType = NULL;
7222 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007223 GLfloat *coords_base = (GLfloat *) 0;
7224 jint _remaining;
7225 GLfloat *coords = (GLfloat *) 0;
7226
7227 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007228 _exception = 1;
7229 _exceptionType = "java/lang/IllegalArgumentException";
7230 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007231 goto exit;
7232 }
7233 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007234 _exception = 1;
7235 _exceptionType = "java/lang/IllegalArgumentException";
7236 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007237 goto exit;
7238 }
7239 _remaining = _env->GetArrayLength(coords_ref) - offset;
7240 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007241 _exception = 1;
7242 _exceptionType = "java/lang/IllegalArgumentException";
7243 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007244 goto exit;
7245 }
7246 coords_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007247 _env->GetFloatArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007248 coords = coords_base + offset;
7249
7250 glDrawTexfvOES(
7251 (GLfloat *)coords
7252 );
7253
7254exit:
7255 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007256 _env->ReleaseFloatArrayElements(coords_ref, (jfloat*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007257 JNI_ABORT);
7258 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007259 if (_exception) {
7260 jniThrowException(_env, _exceptionType, _exceptionMessage);
7261 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007262}
7263
7264/* void glDrawTexfvOES ( const GLfloat *coords ) */
7265static void
7266android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2
7267 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007268 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007269 const char * _exceptionType = NULL;
7270 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007271 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007272 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007273 jint _remaining;
7274 GLfloat *coords = (GLfloat *) 0;
7275
Romain Guy84cac202016-12-05 12:26:02 -08007276 if (!coords_buf) {
7277 _exception = 1;
7278 _exceptionType = "java/lang/IllegalArgumentException";
7279 _exceptionMessage = "coords == null";
7280 goto exit;
7281 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007282 coords = (GLfloat *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007283 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007284 _exception = 1;
7285 _exceptionType = "java/lang/IllegalArgumentException";
7286 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007287 goto exit;
7288 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007289 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007290 char * _coordsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007291 coords = (GLfloat *) (_coordsBase + _bufferOffset);
7292 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007293 glDrawTexfvOES(
7294 (GLfloat *)coords
7295 );
7296
7297exit:
7298 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007299 _env->ReleaseFloatArrayElements(_array, (jfloat*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007300 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007301 if (_exception) {
7302 jniThrowException(_env, _exceptionType, _exceptionMessage);
7303 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007304}
7305
7306/* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */
7307static void
7308android_glDrawTexiOES__IIIII
7309 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7310 glDrawTexiOES(
7311 (GLint)x,
7312 (GLint)y,
7313 (GLint)z,
7314 (GLint)width,
7315 (GLint)height
7316 );
7317}
7318
7319/* void glDrawTexivOES ( const GLint *coords ) */
7320static void
7321android_glDrawTexivOES___3II
7322 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007323 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007324 const char * _exceptionType = NULL;
7325 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007326 GLint *coords_base = (GLint *) 0;
7327 jint _remaining;
7328 GLint *coords = (GLint *) 0;
7329
7330 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007331 _exception = 1;
7332 _exceptionType = "java/lang/IllegalArgumentException";
7333 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007334 goto exit;
7335 }
7336 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007337 _exception = 1;
7338 _exceptionType = "java/lang/IllegalArgumentException";
7339 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007340 goto exit;
7341 }
7342 _remaining = _env->GetArrayLength(coords_ref) - offset;
7343 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007344 _exception = 1;
7345 _exceptionType = "java/lang/IllegalArgumentException";
7346 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007347 goto exit;
7348 }
7349 coords_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007350 _env->GetIntArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007351 coords = coords_base + offset;
7352
7353 glDrawTexivOES(
7354 (GLint *)coords
7355 );
7356
7357exit:
7358 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007359 _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007360 JNI_ABORT);
7361 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007362 if (_exception) {
7363 jniThrowException(_env, _exceptionType, _exceptionMessage);
7364 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007365}
7366
7367/* void glDrawTexivOES ( const GLint *coords ) */
7368static void
7369android_glDrawTexivOES__Ljava_nio_IntBuffer_2
7370 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007371 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007372 const char * _exceptionType = NULL;
7373 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007374 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007375 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007376 jint _remaining;
7377 GLint *coords = (GLint *) 0;
7378
Romain Guy84cac202016-12-05 12:26:02 -08007379 if (!coords_buf) {
7380 _exception = 1;
7381 _exceptionType = "java/lang/IllegalArgumentException";
7382 _exceptionMessage = "coords == null";
7383 goto exit;
7384 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007385 coords = (GLint *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007386 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007387 _exception = 1;
7388 _exceptionType = "java/lang/IllegalArgumentException";
7389 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007390 goto exit;
7391 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007392 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007393 char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007394 coords = (GLint *) (_coordsBase + _bufferOffset);
7395 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007396 glDrawTexivOES(
7397 (GLint *)coords
7398 );
7399
7400exit:
7401 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007402 _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007403 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007404 if (_exception) {
7405 jniThrowException(_env, _exceptionType, _exceptionMessage);
7406 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007407}
7408
7409/* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */
7410static void
7411android_glDrawTexsOES__SSSSS
7412 (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) {
7413 glDrawTexsOES(
7414 (GLshort)x,
7415 (GLshort)y,
7416 (GLshort)z,
7417 (GLshort)width,
7418 (GLshort)height
7419 );
7420}
7421
7422/* void glDrawTexsvOES ( const GLshort *coords ) */
7423static void
7424android_glDrawTexsvOES___3SI
7425 (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007426 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007427 const char * _exceptionType = NULL;
7428 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007429 GLshort *coords_base = (GLshort *) 0;
7430 jint _remaining;
7431 GLshort *coords = (GLshort *) 0;
7432
7433 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007434 _exception = 1;
7435 _exceptionType = "java/lang/IllegalArgumentException";
7436 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007437 goto exit;
7438 }
7439 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007440 _exception = 1;
7441 _exceptionType = "java/lang/IllegalArgumentException";
7442 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007443 goto exit;
7444 }
7445 _remaining = _env->GetArrayLength(coords_ref) - offset;
7446 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007447 _exception = 1;
7448 _exceptionType = "java/lang/IllegalArgumentException";
7449 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007450 goto exit;
7451 }
7452 coords_base = (GLshort *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007453 _env->GetShortArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007454 coords = coords_base + offset;
7455
7456 glDrawTexsvOES(
7457 (GLshort *)coords
7458 );
7459
7460exit:
7461 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007462 _env->ReleaseShortArrayElements(coords_ref, (jshort*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007463 JNI_ABORT);
7464 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007465 if (_exception) {
7466 jniThrowException(_env, _exceptionType, _exceptionMessage);
7467 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007468}
7469
7470/* void glDrawTexsvOES ( const GLshort *coords ) */
7471static void
7472android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2
7473 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007474 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007475 const char * _exceptionType = NULL;
7476 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007477 jshortArray _array = (jshortArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007478 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007479 jint _remaining;
7480 GLshort *coords = (GLshort *) 0;
7481
Romain Guy84cac202016-12-05 12:26:02 -08007482 if (!coords_buf) {
7483 _exception = 1;
7484 _exceptionType = "java/lang/IllegalArgumentException";
7485 _exceptionMessage = "coords == null";
7486 goto exit;
7487 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007488 coords = (GLshort *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007489 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007490 _exception = 1;
7491 _exceptionType = "java/lang/IllegalArgumentException";
7492 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007493 goto exit;
7494 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007495 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007496 char * _coordsBase = (char *)_env->GetShortArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007497 coords = (GLshort *) (_coordsBase + _bufferOffset);
7498 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007499 glDrawTexsvOES(
7500 (GLshort *)coords
7501 );
7502
7503exit:
7504 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007505 _env->ReleaseShortArrayElements(_array, (jshort*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007506 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007507 if (_exception) {
7508 jniThrowException(_env, _exceptionType, _exceptionMessage);
7509 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007510}
7511
7512/* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */
7513static void
7514android_glDrawTexxOES__IIIII
7515 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7516 glDrawTexxOES(
7517 (GLfixed)x,
7518 (GLfixed)y,
7519 (GLfixed)z,
7520 (GLfixed)width,
7521 (GLfixed)height
7522 );
7523}
7524
7525/* void glDrawTexxvOES ( const GLfixed *coords ) */
7526static void
7527android_glDrawTexxvOES___3II
7528 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007529 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007530 const char * _exceptionType = NULL;
7531 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007532 GLfixed *coords_base = (GLfixed *) 0;
7533 jint _remaining;
7534 GLfixed *coords = (GLfixed *) 0;
7535
7536 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007537 _exception = 1;
7538 _exceptionType = "java/lang/IllegalArgumentException";
7539 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007540 goto exit;
7541 }
7542 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007543 _exception = 1;
7544 _exceptionType = "java/lang/IllegalArgumentException";
7545 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007546 goto exit;
7547 }
7548 _remaining = _env->GetArrayLength(coords_ref) - offset;
7549 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007550 _exception = 1;
7551 _exceptionType = "java/lang/IllegalArgumentException";
7552 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007553 goto exit;
7554 }
7555 coords_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007556 _env->GetIntArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007557 coords = coords_base + offset;
7558
7559 glDrawTexxvOES(
7560 (GLfixed *)coords
7561 );
7562
7563exit:
7564 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007565 _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007566 JNI_ABORT);
7567 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007568 if (_exception) {
7569 jniThrowException(_env, _exceptionType, _exceptionMessage);
7570 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007571}
7572
7573/* void glDrawTexxvOES ( const GLfixed *coords ) */
7574static void
7575android_glDrawTexxvOES__Ljava_nio_IntBuffer_2
7576 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007577 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007578 const char * _exceptionType = NULL;
7579 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007580 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007581 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007582 jint _remaining;
7583 GLfixed *coords = (GLfixed *) 0;
7584
Romain Guy84cac202016-12-05 12:26:02 -08007585 if (!coords_buf) {
7586 _exception = 1;
7587 _exceptionType = "java/lang/IllegalArgumentException";
7588 _exceptionMessage = "coords == null";
7589 goto exit;
7590 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007591 coords = (GLfixed *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007592 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007593 _exception = 1;
7594 _exceptionType = "java/lang/IllegalArgumentException";
7595 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007596 goto exit;
7597 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007598 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007599 char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007600 coords = (GLfixed *) (_coordsBase + _bufferOffset);
7601 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007602 glDrawTexxvOES(
7603 (GLfixed *)coords
7604 );
7605
7606exit:
7607 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007608 _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007609 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007610 if (_exception) {
7611 jniThrowException(_env, _exceptionType, _exceptionMessage);
7612 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007613}
7614
7615/* void glLoadPaletteFromModelViewMatrixOES ( void ) */
7616static void
7617android_glLoadPaletteFromModelViewMatrixOES__
7618 (JNIEnv *_env, jobject _this) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007619 glLoadPaletteFromModelViewMatrixOES();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007620}
7621
7622/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7623static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007624android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I
7625 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08007626 jint _exception = 0;
7627 const char * _exceptionType = NULL;
7628 const char * _exceptionMessage = NULL;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007629 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007630 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007631 jint _remaining;
7632 GLvoid *pointer = (GLvoid *) 0;
7633
7634 if (pointer_buf) {
7635 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7636 if ( ! pointer ) {
7637 return;
7638 }
7639 }
7640 glMatrixIndexPointerOESBounds(
7641 (GLint)size,
7642 (GLenum)type,
7643 (GLsizei)stride,
7644 (GLvoid *)pointer,
7645 (GLsizei)remaining
7646 );
Romain Guy84cac202016-12-05 12:26:02 -08007647 if (_exception) {
7648 jniThrowException(_env, _exceptionType, _exceptionMessage);
7649 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007650}
7651
7652/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7653static void
7654android_glMatrixIndexPointerOES__IIII
7655 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007656 glMatrixIndexPointerOES(
7657 (GLint)size,
7658 (GLenum)type,
7659 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007660 reinterpret_cast<GLvoid *>(offset)
Jack Palevichbe6eac82009-12-08 15:43:51 +08007661 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007662}
7663
7664/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7665static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007666android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I
7667 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08007668 jint _exception = 0;
7669 const char * _exceptionType = NULL;
7670 const char * _exceptionMessage = NULL;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007671 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007672 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007673 jint _remaining;
7674 GLvoid *pointer = (GLvoid *) 0;
7675
7676 if (pointer_buf) {
7677 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7678 if ( ! pointer ) {
7679 return;
7680 }
7681 }
7682 glWeightPointerOESBounds(
7683 (GLint)size,
7684 (GLenum)type,
7685 (GLsizei)stride,
7686 (GLvoid *)pointer,
7687 (GLsizei)remaining
7688 );
Romain Guy84cac202016-12-05 12:26:02 -08007689 if (_exception) {
7690 jniThrowException(_env, _exceptionType, _exceptionMessage);
7691 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007692}
7693
7694/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7695static void
7696android_glWeightPointerOES__IIII
7697 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007698 glWeightPointerOES(
7699 (GLint)size,
7700 (GLenum)type,
7701 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007702 reinterpret_cast<GLvoid *>(offset)
Jack Palevichbe6eac82009-12-08 15:43:51 +08007703 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007704}
7705
7706/* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */
7707static void
7708android_glBindFramebufferOES__II
7709 (JNIEnv *_env, jobject _this, jint target, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007710 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007711 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007712 "glBindFramebufferOES");
7713 return;
7714 }
7715 glBindFramebufferOES(
7716 (GLint)target,
7717 (GLint)framebuffer
7718 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007719}
7720
7721/* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */
7722static void
7723android_glBindRenderbufferOES__II
7724 (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007725 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007726 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007727 "glBindRenderbufferOES");
7728 return;
7729 }
7730 glBindRenderbufferOES(
7731 (GLint)target,
7732 (GLint)renderbuffer
7733 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007734}
7735
7736/* void glBlendEquation ( GLint mode ) */
7737static void
7738android_glBlendEquation__I
7739 (JNIEnv *_env, jobject _this, jint mode) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007740 if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007741 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007742 "glBlendEquation");
7743 return;
7744 }
7745 glBlendEquation(
7746 (GLint)mode
7747 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007748}
7749
7750/* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */
7751static void
7752android_glBlendEquationSeparate__II
7753 (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007754 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007755 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007756 "glBlendEquationSeparate");
7757 return;
7758 }
7759 glBlendEquationSeparate(
7760 (GLint)modeRGB,
7761 (GLint)modeAlpha
7762 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007763}
7764
7765/* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */
7766static void
7767android_glBlendFuncSeparate__IIII
7768 (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007769 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007770 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007771 "glBlendFuncSeparate");
7772 return;
7773 }
7774 glBlendFuncSeparate(
7775 (GLint)srcRGB,
7776 (GLint)dstRGB,
7777 (GLint)srcAlpha,
7778 (GLint)dstAlpha
7779 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007780}
7781
7782/* GLint glCheckFramebufferStatusOES ( GLint target ) */
7783static jint
7784android_glCheckFramebufferStatusOES__I
7785 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007786 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007787 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007788 "glCheckFramebufferStatusOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007789 return 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007790 }
7791 GLint _returnValue = 0;
7792 _returnValue = glCheckFramebufferStatusOES(
7793 (GLint)target
7794 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07007795 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007796}
7797
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007798/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007799static void
7800android_glDeleteFramebuffersOES__I_3II
7801 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007802 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007803 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007804 "glDeleteFramebuffersOES");
7805 return;
7806 }
7807 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007808 const char * _exceptionType = NULL;
7809 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007810 GLuint *framebuffers_base = (GLuint *) 0;
7811 jint _remaining;
7812 GLuint *framebuffers = (GLuint *) 0;
7813
7814 if (!framebuffers_ref) {
7815 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007816 _exceptionType = "java/lang/IllegalArgumentException";
7817 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007818 goto exit;
7819 }
7820 if (offset < 0) {
7821 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007822 _exceptionType = "java/lang/IllegalArgumentException";
7823 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007824 goto exit;
7825 }
7826 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
7827 if (_remaining < n) {
7828 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007829 _exceptionType = "java/lang/IllegalArgumentException";
7830 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007831 goto exit;
7832 }
7833 framebuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007834 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007835 framebuffers = framebuffers_base + offset;
7836
7837 glDeleteFramebuffersOES(
7838 (GLint)n,
7839 (GLuint *)framebuffers
7840 );
7841
7842exit:
7843 if (framebuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007844 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007845 _exception ? JNI_ABORT: 0);
7846 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007847 if (_exception) {
7848 jniThrowException(_env, _exceptionType, _exceptionMessage);
7849 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007850}
7851
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007852/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007853static void
7854android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2
7855 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007856 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007857 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007858 "glDeleteFramebuffersOES");
7859 return;
7860 }
7861 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007862 const char * _exceptionType = NULL;
7863 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007864 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007865 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007866 jint _remaining;
7867 GLuint *framebuffers = (GLuint *) 0;
7868
Romain Guy84cac202016-12-05 12:26:02 -08007869 if (!framebuffers_buf) {
7870 _exception = 1;
7871 _exceptionType = "java/lang/IllegalArgumentException";
7872 _exceptionMessage = "framebuffers == null";
7873 goto exit;
7874 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007875 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007876 if (_remaining < n) {
7877 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007878 _exceptionType = "java/lang/IllegalArgumentException";
7879 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007880 goto exit;
7881 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007882 if (framebuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007883 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007884 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
7885 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007886 glDeleteFramebuffersOES(
7887 (GLint)n,
7888 (GLuint *)framebuffers
7889 );
7890
7891exit:
7892 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007893 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007894 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007895 if (_exception) {
7896 jniThrowException(_env, _exceptionType, _exceptionMessage);
7897 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007898}
7899
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007900/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007901static void
7902android_glDeleteRenderbuffersOES__I_3II
7903 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007904 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007905 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007906 "glDeleteRenderbuffersOES");
7907 return;
7908 }
7909 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007910 const char * _exceptionType = NULL;
7911 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007912 GLuint *renderbuffers_base = (GLuint *) 0;
7913 jint _remaining;
7914 GLuint *renderbuffers = (GLuint *) 0;
7915
7916 if (!renderbuffers_ref) {
7917 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007918 _exceptionType = "java/lang/IllegalArgumentException";
7919 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007920 goto exit;
7921 }
7922 if (offset < 0) {
7923 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007924 _exceptionType = "java/lang/IllegalArgumentException";
7925 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007926 goto exit;
7927 }
7928 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
7929 if (_remaining < n) {
7930 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007931 _exceptionType = "java/lang/IllegalArgumentException";
7932 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007933 goto exit;
7934 }
7935 renderbuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007936 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007937 renderbuffers = renderbuffers_base + offset;
7938
7939 glDeleteRenderbuffersOES(
7940 (GLint)n,
7941 (GLuint *)renderbuffers
7942 );
7943
7944exit:
7945 if (renderbuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007946 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007947 _exception ? JNI_ABORT: 0);
7948 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007949 if (_exception) {
7950 jniThrowException(_env, _exceptionType, _exceptionMessage);
7951 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007952}
7953
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007954/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007955static void
7956android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2
7957 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007958 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007959 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007960 "glDeleteRenderbuffersOES");
7961 return;
7962 }
7963 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007964 const char * _exceptionType = NULL;
7965 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007966 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007967 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007968 jint _remaining;
7969 GLuint *renderbuffers = (GLuint *) 0;
7970
Romain Guy84cac202016-12-05 12:26:02 -08007971 if (!renderbuffers_buf) {
7972 _exception = 1;
7973 _exceptionType = "java/lang/IllegalArgumentException";
7974 _exceptionMessage = "renderbuffers == null";
7975 goto exit;
7976 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007977 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007978 if (_remaining < n) {
7979 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007980 _exceptionType = "java/lang/IllegalArgumentException";
7981 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007982 goto exit;
7983 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007984 if (renderbuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007985 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007986 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
7987 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007988 glDeleteRenderbuffersOES(
7989 (GLint)n,
7990 (GLuint *)renderbuffers
7991 );
7992
7993exit:
7994 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007995 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007996 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007997 if (_exception) {
7998 jniThrowException(_env, _exceptionType, _exceptionMessage);
7999 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008000}
8001
8002/* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */
8003static void
8004android_glFramebufferRenderbufferOES__IIII
8005 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008006 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008007 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008008 "glFramebufferRenderbufferOES");
8009 return;
8010 }
8011 glFramebufferRenderbufferOES(
8012 (GLint)target,
8013 (GLint)attachment,
8014 (GLint)renderbuffertarget,
8015 (GLint)renderbuffer
8016 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008017}
8018
8019/* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */
8020static void
8021android_glFramebufferTexture2DOES__IIIII
8022 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008023 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008024 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008025 "glFramebufferTexture2DOES");
8026 return;
8027 }
8028 glFramebufferTexture2DOES(
8029 (GLint)target,
8030 (GLint)attachment,
8031 (GLint)textarget,
8032 (GLint)texture,
8033 (GLint)level
8034 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008035}
8036
8037/* void glGenerateMipmapOES ( GLint target ) */
8038static void
8039android_glGenerateMipmapOES__I
8040 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008041 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008042 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008043 "glGenerateMipmapOES");
8044 return;
8045 }
8046 glGenerateMipmapOES(
8047 (GLint)target
8048 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008049}
8050
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008051/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008052static void
8053android_glGenFramebuffersOES__I_3II
8054 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008055 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008056 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008057 "glGenFramebuffersOES");
8058 return;
8059 }
8060 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008061 const char * _exceptionType = NULL;
8062 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008063 GLuint *framebuffers_base = (GLuint *) 0;
8064 jint _remaining;
8065 GLuint *framebuffers = (GLuint *) 0;
8066
8067 if (!framebuffers_ref) {
8068 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008069 _exceptionType = "java/lang/IllegalArgumentException";
8070 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008071 goto exit;
8072 }
8073 if (offset < 0) {
8074 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008075 _exceptionType = "java/lang/IllegalArgumentException";
8076 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008077 goto exit;
8078 }
8079 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
8080 if (_remaining < n) {
8081 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008082 _exceptionType = "java/lang/IllegalArgumentException";
8083 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008084 goto exit;
8085 }
8086 framebuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008087 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008088 framebuffers = framebuffers_base + offset;
8089
8090 glGenFramebuffersOES(
8091 (GLint)n,
8092 (GLuint *)framebuffers
8093 );
8094
8095exit:
8096 if (framebuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008097 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008098 _exception ? JNI_ABORT: 0);
8099 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008100 if (_exception) {
8101 jniThrowException(_env, _exceptionType, _exceptionMessage);
8102 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008103}
8104
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008105/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008106static void
8107android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2
8108 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008109 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008110 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008111 "glGenFramebuffersOES");
8112 return;
8113 }
8114 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008115 const char * _exceptionType = NULL;
8116 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008117 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008118 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008119 jint _remaining;
8120 GLuint *framebuffers = (GLuint *) 0;
8121
Romain Guy84cac202016-12-05 12:26:02 -08008122 if (!framebuffers_buf) {
8123 _exception = 1;
8124 _exceptionType = "java/lang/IllegalArgumentException";
8125 _exceptionMessage = "framebuffers == null";
8126 goto exit;
8127 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008128 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008129 if (_remaining < n) {
8130 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008131 _exceptionType = "java/lang/IllegalArgumentException";
8132 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008133 goto exit;
8134 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008135 if (framebuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008136 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008137 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
8138 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008139 glGenFramebuffersOES(
8140 (GLint)n,
8141 (GLuint *)framebuffers
8142 );
8143
8144exit:
8145 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008146 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008147 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008148 if (_exception) {
8149 jniThrowException(_env, _exceptionType, _exceptionMessage);
8150 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008151}
8152
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008153/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008154static void
8155android_glGenRenderbuffersOES__I_3II
8156 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008157 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008158 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008159 "glGenRenderbuffersOES");
8160 return;
8161 }
8162 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008163 const char * _exceptionType = NULL;
8164 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008165 GLuint *renderbuffers_base = (GLuint *) 0;
8166 jint _remaining;
8167 GLuint *renderbuffers = (GLuint *) 0;
8168
8169 if (!renderbuffers_ref) {
8170 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008171 _exceptionType = "java/lang/IllegalArgumentException";
8172 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008173 goto exit;
8174 }
8175 if (offset < 0) {
8176 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008177 _exceptionType = "java/lang/IllegalArgumentException";
8178 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008179 goto exit;
8180 }
8181 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
8182 if (_remaining < n) {
8183 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008184 _exceptionType = "java/lang/IllegalArgumentException";
8185 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008186 goto exit;
8187 }
8188 renderbuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008189 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008190 renderbuffers = renderbuffers_base + offset;
8191
8192 glGenRenderbuffersOES(
8193 (GLint)n,
8194 (GLuint *)renderbuffers
8195 );
8196
8197exit:
8198 if (renderbuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008199 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008200 _exception ? JNI_ABORT: 0);
8201 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008202 if (_exception) {
8203 jniThrowException(_env, _exceptionType, _exceptionMessage);
8204 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008205}
8206
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008207/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008208static void
8209android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2
8210 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008211 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008212 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008213 "glGenRenderbuffersOES");
8214 return;
8215 }
8216 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008217 const char * _exceptionType = NULL;
8218 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008219 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008220 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008221 jint _remaining;
8222 GLuint *renderbuffers = (GLuint *) 0;
8223
Romain Guy84cac202016-12-05 12:26:02 -08008224 if (!renderbuffers_buf) {
8225 _exception = 1;
8226 _exceptionType = "java/lang/IllegalArgumentException";
8227 _exceptionMessage = "renderbuffers == null";
8228 goto exit;
8229 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008230 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008231 if (_remaining < n) {
8232 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008233 _exceptionType = "java/lang/IllegalArgumentException";
8234 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008235 goto exit;
8236 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008237 if (renderbuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008238 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008239 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
8240 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008241 glGenRenderbuffersOES(
8242 (GLint)n,
8243 (GLuint *)renderbuffers
8244 );
8245
8246exit:
8247 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008248 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008249 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008250 if (_exception) {
8251 jniThrowException(_env, _exceptionType, _exceptionMessage);
8252 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008253}
8254
8255/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
8256static void
8257android_glGetFramebufferAttachmentParameterivOES__III_3II
8258 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008259 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008260 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008261 "glGetFramebufferAttachmentParameterivOES");
8262 return;
8263 }
8264 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008265 const char * _exceptionType = NULL;
8266 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008267 GLint *params_base = (GLint *) 0;
8268 jint _remaining;
8269 GLint *params = (GLint *) 0;
8270
8271 if (!params_ref) {
8272 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008273 _exceptionType = "java/lang/IllegalArgumentException";
8274 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008275 goto exit;
8276 }
8277 if (offset < 0) {
8278 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008279 _exceptionType = "java/lang/IllegalArgumentException";
8280 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008281 goto exit;
8282 }
8283 _remaining = _env->GetArrayLength(params_ref) - offset;
8284 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008285 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008286 params = params_base + offset;
8287
8288 glGetFramebufferAttachmentParameterivOES(
8289 (GLint)target,
8290 (GLint)attachment,
8291 (GLint)pname,
8292 (GLint *)params
8293 );
8294
8295exit:
8296 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008297 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008298 _exception ? JNI_ABORT: 0);
8299 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008300 if (_exception) {
8301 jniThrowException(_env, _exceptionType, _exceptionMessage);
8302 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008303}
8304
8305/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
8306static void
8307android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2
8308 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008309 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008310 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008311 "glGetFramebufferAttachmentParameterivOES");
8312 return;
8313 }
Romain Guy84cac202016-12-05 12:26:02 -08008314 jint _exception = 0;
8315 const char * _exceptionType = NULL;
8316 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008317 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008318 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008319 jint _remaining;
8320 GLint *params = (GLint *) 0;
8321
Romain Guy84cac202016-12-05 12:26:02 -08008322 if (!params_buf) {
8323 _exception = 1;
8324 _exceptionType = "java/lang/IllegalArgumentException";
8325 _exceptionMessage = "params == null";
8326 goto exit;
8327 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008328 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008329 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008330 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008331 params = (GLint *) (_paramsBase + _bufferOffset);
8332 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008333 glGetFramebufferAttachmentParameterivOES(
8334 (GLint)target,
8335 (GLint)attachment,
8336 (GLint)pname,
8337 (GLint *)params
8338 );
Romain Guy84cac202016-12-05 12:26:02 -08008339
8340exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008341 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008342 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8343 }
8344 if (_exception) {
8345 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008346 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008347}
8348
8349/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
8350static void
8351android_glGetRenderbufferParameterivOES__II_3II
8352 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008353 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008354 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008355 "glGetRenderbufferParameterivOES");
8356 return;
8357 }
8358 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008359 const char * _exceptionType = NULL;
8360 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008361 GLint *params_base = (GLint *) 0;
8362 jint _remaining;
8363 GLint *params = (GLint *) 0;
8364
8365 if (!params_ref) {
8366 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008367 _exceptionType = "java/lang/IllegalArgumentException";
8368 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008369 goto exit;
8370 }
8371 if (offset < 0) {
8372 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008373 _exceptionType = "java/lang/IllegalArgumentException";
8374 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008375 goto exit;
8376 }
8377 _remaining = _env->GetArrayLength(params_ref) - offset;
8378 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008379 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008380 params = params_base + offset;
8381
8382 glGetRenderbufferParameterivOES(
8383 (GLint)target,
8384 (GLint)pname,
8385 (GLint *)params
8386 );
8387
8388exit:
8389 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008390 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008391 _exception ? JNI_ABORT: 0);
8392 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008393 if (_exception) {
8394 jniThrowException(_env, _exceptionType, _exceptionMessage);
8395 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008396}
8397
8398/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
8399static void
8400android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2
8401 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008402 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008403 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008404 "glGetRenderbufferParameterivOES");
8405 return;
8406 }
Romain Guy84cac202016-12-05 12:26:02 -08008407 jint _exception = 0;
8408 const char * _exceptionType = NULL;
8409 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008410 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008411 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008412 jint _remaining;
8413 GLint *params = (GLint *) 0;
8414
Romain Guy84cac202016-12-05 12:26:02 -08008415 if (!params_buf) {
8416 _exception = 1;
8417 _exceptionType = "java/lang/IllegalArgumentException";
8418 _exceptionMessage = "params == null";
8419 goto exit;
8420 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008421 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008422 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008423 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008424 params = (GLint *) (_paramsBase + _bufferOffset);
8425 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008426 glGetRenderbufferParameterivOES(
8427 (GLint)target,
8428 (GLint)pname,
8429 (GLint *)params
8430 );
Romain Guy84cac202016-12-05 12:26:02 -08008431
8432exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008433 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008434 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8435 }
8436 if (_exception) {
8437 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008438 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008439}
8440
8441/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8442static void
8443android_glGetTexGenfv__II_3FI
8444 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008445 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008446 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008447 "glGetTexGenfv");
8448 return;
8449 }
8450 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008451 const char * _exceptionType = NULL;
8452 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008453 GLfloat *params_base = (GLfloat *) 0;
8454 jint _remaining;
8455 GLfloat *params = (GLfloat *) 0;
8456
8457 if (!params_ref) {
8458 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008459 _exceptionType = "java/lang/IllegalArgumentException";
8460 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008461 goto exit;
8462 }
8463 if (offset < 0) {
8464 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008465 _exceptionType = "java/lang/IllegalArgumentException";
8466 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008467 goto exit;
8468 }
8469 _remaining = _env->GetArrayLength(params_ref) - offset;
8470 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008471 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008472 params = params_base + offset;
8473
8474 glGetTexGenfv(
8475 (GLint)coord,
8476 (GLint)pname,
8477 (GLfloat *)params
8478 );
8479
8480exit:
8481 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008482 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008483 _exception ? JNI_ABORT: 0);
8484 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008485 if (_exception) {
8486 jniThrowException(_env, _exceptionType, _exceptionMessage);
8487 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008488}
8489
8490/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8491static void
8492android_glGetTexGenfv__IILjava_nio_FloatBuffer_2
8493 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008494 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008495 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008496 "glGetTexGenfv");
8497 return;
8498 }
Romain Guy84cac202016-12-05 12:26:02 -08008499 jint _exception = 0;
8500 const char * _exceptionType = NULL;
8501 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008502 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008503 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008504 jint _remaining;
8505 GLfloat *params = (GLfloat *) 0;
8506
Romain Guy84cac202016-12-05 12:26:02 -08008507 if (!params_buf) {
8508 _exception = 1;
8509 _exceptionType = "java/lang/IllegalArgumentException";
8510 _exceptionMessage = "params == null";
8511 goto exit;
8512 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008513 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008514 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008515 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008516 params = (GLfloat *) (_paramsBase + _bufferOffset);
8517 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008518 glGetTexGenfv(
8519 (GLint)coord,
8520 (GLint)pname,
8521 (GLfloat *)params
8522 );
Romain Guy84cac202016-12-05 12:26:02 -08008523
8524exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008525 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008526 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
8527 }
8528 if (_exception) {
8529 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008530 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008531}
8532
8533/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8534static void
8535android_glGetTexGeniv__II_3II
8536 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008537 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008538 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008539 "glGetTexGeniv");
8540 return;
8541 }
8542 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008543 const char * _exceptionType = NULL;
8544 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008545 GLint *params_base = (GLint *) 0;
8546 jint _remaining;
8547 GLint *params = (GLint *) 0;
8548
8549 if (!params_ref) {
8550 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008551 _exceptionType = "java/lang/IllegalArgumentException";
8552 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008553 goto exit;
8554 }
8555 if (offset < 0) {
8556 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008557 _exceptionType = "java/lang/IllegalArgumentException";
8558 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008559 goto exit;
8560 }
8561 _remaining = _env->GetArrayLength(params_ref) - offset;
8562 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008563 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008564 params = params_base + offset;
8565
8566 glGetTexGeniv(
8567 (GLint)coord,
8568 (GLint)pname,
8569 (GLint *)params
8570 );
8571
8572exit:
8573 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008574 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008575 _exception ? JNI_ABORT: 0);
8576 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008577 if (_exception) {
8578 jniThrowException(_env, _exceptionType, _exceptionMessage);
8579 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008580}
8581
8582/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8583static void
8584android_glGetTexGeniv__IILjava_nio_IntBuffer_2
8585 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008586 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008587 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008588 "glGetTexGeniv");
8589 return;
8590 }
Romain Guy84cac202016-12-05 12:26:02 -08008591 jint _exception = 0;
8592 const char * _exceptionType = NULL;
8593 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008594 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008595 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008596 jint _remaining;
8597 GLint *params = (GLint *) 0;
8598
Romain Guy84cac202016-12-05 12:26:02 -08008599 if (!params_buf) {
8600 _exception = 1;
8601 _exceptionType = "java/lang/IllegalArgumentException";
8602 _exceptionMessage = "params == null";
8603 goto exit;
8604 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008605 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008606 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008607 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008608 params = (GLint *) (_paramsBase + _bufferOffset);
8609 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008610 glGetTexGeniv(
8611 (GLint)coord,
8612 (GLint)pname,
8613 (GLint *)params
8614 );
Romain Guy84cac202016-12-05 12:26:02 -08008615
8616exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008617 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008618 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8619 }
8620 if (_exception) {
8621 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008622 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008623}
8624
8625/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8626static void
8627android_glGetTexGenxv__II_3II
8628 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008629 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008630 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008631 "glGetTexGenxv");
8632 return;
8633 }
8634 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008635 const char * _exceptionType = NULL;
8636 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008637 GLint *params_base = (GLint *) 0;
8638 jint _remaining;
8639 GLint *params = (GLint *) 0;
8640
8641 if (!params_ref) {
8642 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008643 _exceptionType = "java/lang/IllegalArgumentException";
8644 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008645 goto exit;
8646 }
8647 if (offset < 0) {
8648 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008649 _exceptionType = "java/lang/IllegalArgumentException";
8650 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008651 goto exit;
8652 }
8653 _remaining = _env->GetArrayLength(params_ref) - offset;
8654 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008655 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008656 params = params_base + offset;
8657
8658 glGetTexGenxv(
8659 (GLint)coord,
8660 (GLint)pname,
8661 (GLint *)params
8662 );
8663
8664exit:
8665 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008666 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008667 _exception ? JNI_ABORT: 0);
8668 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008669 if (_exception) {
8670 jniThrowException(_env, _exceptionType, _exceptionMessage);
8671 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008672}
8673
8674/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8675static void
8676android_glGetTexGenxv__IILjava_nio_IntBuffer_2
8677 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008678 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008679 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008680 "glGetTexGenxv");
8681 return;
8682 }
Romain Guy84cac202016-12-05 12:26:02 -08008683 jint _exception = 0;
8684 const char * _exceptionType = NULL;
8685 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008686 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008687 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008688 jint _remaining;
8689 GLint *params = (GLint *) 0;
8690
Romain Guy84cac202016-12-05 12:26:02 -08008691 if (!params_buf) {
8692 _exception = 1;
8693 _exceptionType = "java/lang/IllegalArgumentException";
8694 _exceptionMessage = "params == null";
8695 goto exit;
8696 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008697 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008698 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008699 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008700 params = (GLint *) (_paramsBase + _bufferOffset);
8701 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008702 glGetTexGenxv(
8703 (GLint)coord,
8704 (GLint)pname,
8705 (GLint *)params
8706 );
Romain Guy84cac202016-12-05 12:26:02 -08008707
8708exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008709 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008710 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8711 }
8712 if (_exception) {
8713 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008714 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008715}
8716
8717/* GLboolean glIsFramebufferOES ( GLint framebuffer ) */
8718static jboolean
8719android_glIsFramebufferOES__I
8720 (JNIEnv *_env, jobject _this, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008721 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008722 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008723 "glIsFramebufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008724 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008725 }
8726 GLboolean _returnValue = JNI_FALSE;
8727 _returnValue = glIsFramebufferOES(
8728 (GLint)framebuffer
8729 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07008730 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008731}
8732
8733/* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */
8734static jboolean
8735android_glIsRenderbufferOES__I
8736 (JNIEnv *_env, jobject _this, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008737 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008738 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008739 "glIsRenderbufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008740 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008741 }
8742 GLboolean _returnValue = JNI_FALSE;
8743 _returnValue = glIsRenderbufferOES(
8744 (GLint)renderbuffer
8745 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07008746 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008747}
8748
8749/* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */
8750static void
8751android_glRenderbufferStorageOES__IIII
8752 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008753 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008754 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008755 "glRenderbufferStorageOES");
8756 return;
8757 }
8758 glRenderbufferStorageOES(
8759 (GLint)target,
8760 (GLint)internalformat,
8761 (GLint)width,
8762 (GLint)height
8763 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008764}
8765
8766/* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */
8767static void
8768android_glTexGenf__IIF
8769 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008770 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008771 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008772 "glTexGenf");
8773 return;
8774 }
8775 glTexGenf(
8776 (GLint)coord,
8777 (GLint)pname,
8778 (GLfloat)param
8779 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008780}
8781
8782/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8783static void
8784android_glTexGenfv__II_3FI
8785 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008786 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008787 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008788 "glTexGenfv");
8789 return;
8790 }
8791 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008792 const char * _exceptionType = NULL;
8793 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008794 GLfloat *params_base = (GLfloat *) 0;
8795 jint _remaining;
8796 GLfloat *params = (GLfloat *) 0;
8797
8798 if (!params_ref) {
8799 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008800 _exceptionType = "java/lang/IllegalArgumentException";
8801 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008802 goto exit;
8803 }
8804 if (offset < 0) {
8805 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008806 _exceptionType = "java/lang/IllegalArgumentException";
8807 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008808 goto exit;
8809 }
8810 _remaining = _env->GetArrayLength(params_ref) - offset;
8811 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008812 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008813 params = params_base + offset;
8814
8815 glTexGenfv(
8816 (GLint)coord,
8817 (GLint)pname,
8818 (GLfloat *)params
8819 );
8820
8821exit:
8822 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008823 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008824 _exception ? JNI_ABORT: 0);
8825 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008826 if (_exception) {
8827 jniThrowException(_env, _exceptionType, _exceptionMessage);
8828 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008829}
8830
8831/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8832static void
8833android_glTexGenfv__IILjava_nio_FloatBuffer_2
8834 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008835 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008836 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008837 "glTexGenfv");
8838 return;
8839 }
Romain Guy84cac202016-12-05 12:26:02 -08008840 jint _exception = 0;
8841 const char * _exceptionType = NULL;
8842 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008843 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008844 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008845 jint _remaining;
8846 GLfloat *params = (GLfloat *) 0;
8847
Romain Guy84cac202016-12-05 12:26:02 -08008848 if (!params_buf) {
8849 _exception = 1;
8850 _exceptionType = "java/lang/IllegalArgumentException";
8851 _exceptionMessage = "params == null";
8852 goto exit;
8853 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008854 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008855 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008856 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008857 params = (GLfloat *) (_paramsBase + _bufferOffset);
8858 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008859 glTexGenfv(
8860 (GLint)coord,
8861 (GLint)pname,
8862 (GLfloat *)params
8863 );
Romain Guy84cac202016-12-05 12:26:02 -08008864
8865exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008866 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008867 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
8868 }
8869 if (_exception) {
8870 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008871 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008872}
8873
8874/* void glTexGeni ( GLint coord, GLint pname, GLint param ) */
8875static void
8876android_glTexGeni__III
8877 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008878 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008879 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008880 "glTexGeni");
8881 return;
8882 }
8883 glTexGeni(
8884 (GLint)coord,
8885 (GLint)pname,
8886 (GLint)param
8887 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008888}
8889
8890/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8891static void
8892android_glTexGeniv__II_3II
8893 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008894 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008895 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008896 "glTexGeniv");
8897 return;
8898 }
8899 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008900 const char * _exceptionType = NULL;
8901 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008902 GLint *params_base = (GLint *) 0;
8903 jint _remaining;
8904 GLint *params = (GLint *) 0;
8905
8906 if (!params_ref) {
8907 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008908 _exceptionType = "java/lang/IllegalArgumentException";
8909 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008910 goto exit;
8911 }
8912 if (offset < 0) {
8913 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008914 _exceptionType = "java/lang/IllegalArgumentException";
8915 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008916 goto exit;
8917 }
8918 _remaining = _env->GetArrayLength(params_ref) - offset;
8919 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008920 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008921 params = params_base + offset;
8922
8923 glTexGeniv(
8924 (GLint)coord,
8925 (GLint)pname,
8926 (GLint *)params
8927 );
8928
8929exit:
8930 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008931 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008932 _exception ? JNI_ABORT: 0);
8933 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008934 if (_exception) {
8935 jniThrowException(_env, _exceptionType, _exceptionMessage);
8936 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008937}
8938
8939/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8940static void
8941android_glTexGeniv__IILjava_nio_IntBuffer_2
8942 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008943 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008944 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008945 "glTexGeniv");
8946 return;
8947 }
Romain Guy84cac202016-12-05 12:26:02 -08008948 jint _exception = 0;
8949 const char * _exceptionType = NULL;
8950 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008951 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008952 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008953 jint _remaining;
8954 GLint *params = (GLint *) 0;
8955
Romain Guy84cac202016-12-05 12:26:02 -08008956 if (!params_buf) {
8957 _exception = 1;
8958 _exceptionType = "java/lang/IllegalArgumentException";
8959 _exceptionMessage = "params == null";
8960 goto exit;
8961 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008962 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008963 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008964 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008965 params = (GLint *) (_paramsBase + _bufferOffset);
8966 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008967 glTexGeniv(
8968 (GLint)coord,
8969 (GLint)pname,
8970 (GLint *)params
8971 );
Romain Guy84cac202016-12-05 12:26:02 -08008972
8973exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008974 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008975 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8976 }
8977 if (_exception) {
8978 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008979 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008980}
8981
8982/* void glTexGenx ( GLint coord, GLint pname, GLint param ) */
8983static void
8984android_glTexGenx__III
8985 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008986 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008987 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008988 "glTexGenx");
8989 return;
8990 }
8991 glTexGenx(
8992 (GLint)coord,
8993 (GLint)pname,
8994 (GLint)param
8995 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008996}
8997
8998/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8999static void
9000android_glTexGenxv__II_3II
9001 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009002 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07009003 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009004 "glTexGenxv");
9005 return;
9006 }
9007 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08009008 const char * _exceptionType = NULL;
9009 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009010 GLint *params_base = (GLint *) 0;
9011 jint _remaining;
9012 GLint *params = (GLint *) 0;
9013
9014 if (!params_ref) {
9015 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07009016 _exceptionType = "java/lang/IllegalArgumentException";
9017 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009018 goto exit;
9019 }
9020 if (offset < 0) {
9021 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07009022 _exceptionType = "java/lang/IllegalArgumentException";
9023 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009024 goto exit;
9025 }
9026 _remaining = _env->GetArrayLength(params_ref) - offset;
9027 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009028 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009029 params = params_base + offset;
9030
9031 glTexGenxv(
9032 (GLint)coord,
9033 (GLint)pname,
9034 (GLint *)params
9035 );
9036
9037exit:
9038 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009039 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009040 _exception ? JNI_ABORT: 0);
9041 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07009042 if (_exception) {
9043 jniThrowException(_env, _exceptionType, _exceptionMessage);
9044 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009045}
9046
9047/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
9048static void
9049android_glTexGenxv__IILjava_nio_IntBuffer_2
9050 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009051 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07009052 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009053 "glTexGenxv");
9054 return;
9055 }
Romain Guy84cac202016-12-05 12:26:02 -08009056 jint _exception = 0;
9057 const char * _exceptionType = NULL;
9058 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009059 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07009060 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009061 jint _remaining;
9062 GLint *params = (GLint *) 0;
9063
Romain Guy84cac202016-12-05 12:26:02 -08009064 if (!params_buf) {
9065 _exception = 1;
9066 _exceptionType = "java/lang/IllegalArgumentException";
9067 _exceptionMessage = "params == null";
9068 goto exit;
9069 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009070 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07009071 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009072 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07009073 params = (GLint *) (_paramsBase + _bufferOffset);
9074 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009075 glTexGenxv(
9076 (GLint)coord,
9077 (GLint)pname,
9078 (GLint *)params
9079 );
Romain Guy84cac202016-12-05 12:26:02 -08009080
9081exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009082 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08009083 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
9084 }
9085 if (_exception) {
9086 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009087 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009088}
9089
9090static const char *classPathName = "com/google/android/gles_jni/GLImpl";
9091
Daniel Micay76f6a862015-09-19 17:31:01 -04009092static const JNINativeMethod methods[] = {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009093{"_nativeClassInit", "()V", (void*)nativeClassInit },
9094{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
9095{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
9096{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
9097{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
9098{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
9099{"glClear", "(I)V", (void *) android_glClear__I },
9100{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
9101{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
9102{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
9103{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
9104{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
9105{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
9106{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
9107{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
9108{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
9109{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
9110{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
9111{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
9112{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
9113{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
9114{"glCullFace", "(I)V", (void *) android_glCullFace__I },
9115{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
9116{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
9117{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
9118{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
9119{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
9120{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
9121{"glDisable", "(I)V", (void *) android_glDisable__I },
9122{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
9123{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
9124{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
9125{"glEnable", "(I)V", (void *) android_glEnable__I },
9126{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
9127{"glFinish", "()V", (void *) android_glFinish__ },
9128{"glFlush", "()V", (void *) android_glFlush__ },
9129{"glFogf", "(IF)V", (void *) android_glFogf__IF },
9130{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
9131{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
9132{"glFogx", "(II)V", (void *) android_glFogx__II },
9133{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
9134{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
9135{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
9136{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
9137{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
9138{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
9139{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
9140{"glGetError", "()I", (void *) android_glGetError__ },
9141{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
9142{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
9143{"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
9144{"glHint", "(II)V", (void *) android_glHint__II },
9145{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
9146{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
9147{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
9148{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
9149{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
9150{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
9151{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
9152{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
9153{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
9154{"glLightx", "(III)V", (void *) android_glLightx__III },
9155{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
9156{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
9157{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
9158{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
9159{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
9160{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
9161{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
9162{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
9163{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
9164{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
9165{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
9166{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
9167{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
9168{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
9169{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
9170{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
9171{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
9172{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
9173{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
9174{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
9175{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
9176{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
9177{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
9178{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
9179{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
9180{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
9181{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
9182{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
9183{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
9184{"glPointSize", "(F)V", (void *) android_glPointSize__F },
9185{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
9186{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
9187{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
9188{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
9189{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
9190{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
9191{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
9192{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
9193{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
9194{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
9195{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
9196{"glScalex", "(III)V", (void *) android_glScalex__III },
9197{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
9198{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
9199{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
9200{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
9201{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
9202{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
9203{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
9204{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
9205{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
9206{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
9207{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
9208{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
9209{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
9210{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
9211{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
9212{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
9213{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
9214{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
9215{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
9216{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
9217{"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II },
9218{"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
9219{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
9220{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
9221{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 },
9222{"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI },
9223{"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 },
9224{"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II },
9225{"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 },
9226{"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB },
9227{"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII },
9228{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II },
9229{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 },
9230{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII },
9231{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II },
9232{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 },
9233{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI },
9234{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 },
9235{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II },
9236{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 },
9237{"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI },
9238{"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 },
9239{"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II },
9240{"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 },
9241{"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II },
9242{"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 },
9243{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI },
9244{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 },
9245{"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI },
9246{"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 },
9247{"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II },
9248{"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 },
9249{"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI },
9250{"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 },
9251{"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II },
9252{"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 },
9253{"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II },
9254{"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 },
9255{"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II },
9256{"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 },
9257{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
9258{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
9259{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II },
9260{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 },
9261{"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II },
9262{"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 },
9263{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I },
9264{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I },
9265{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I },
9266{"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III },
9267{"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF },
9268{"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI },
9269{"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 },
9270{"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II },
9271{"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II },
9272{"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 },
Jack Palevichbe6eac82009-12-08 15:43:51 +08009273{"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009274{"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII },
9275{"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III },
9276{"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II },
9277{"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 },
9278{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI },
9279{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 },
9280{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III },
9281{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II },
9282{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 },
9283{"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II },
9284{"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 },
9285{"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII },
9286{"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I },
9287{"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF },
9288{"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI },
9289{"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 },
9290{"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII },
9291{"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II },
9292{"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 },
9293{"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS },
9294{"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI },
9295{"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 },
9296{"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII },
9297{"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II },
9298{"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 },
9299{"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ },
Jack Palevichbe6eac82009-12-08 15:43:51 +08009300{"glMatrixIndexPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009301{"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII },
Jack Palevichbe6eac82009-12-08 15:43:51 +08009302{"glWeightPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009303{"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII },
9304{"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II },
9305{"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II },
9306{"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I },
9307{"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II },
9308{"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII },
9309{"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I },
9310{"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II },
9311{"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 },
9312{"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II },
9313{"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 },
9314{"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII },
9315{"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII },
9316{"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I },
9317{"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II },
9318{"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 },
9319{"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II },
9320{"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 },
9321{"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II },
9322{"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 },
9323{"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II },
9324{"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 },
9325{"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI },
9326{"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 },
9327{"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II },
9328{"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 },
9329{"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II },
9330{"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 },
9331{"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I },
9332{"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I },
9333{"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII },
9334{"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF },
9335{"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI },
9336{"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 },
9337{"glTexGeni", "(III)V", (void *) android_glTexGeni__III },
9338{"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II },
9339{"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 },
9340{"glTexGenx", "(III)V", (void *) android_glTexGenx__III },
9341{"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II },
9342{"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 },
9343};
9344
9345int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env)
9346{
9347 int err;
9348 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
9349 return err;
9350}