blob: 6b893cb9444471b72ef4a343bd5322a83bf651a6 [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
Jack Palevich91a27ae2009-06-15 21:03:24 -070068static jclass G11ImplClass;
Jack Palevich8a4de4b2010-01-28 20:28:32 +080069static jfieldID haveCheckedExtensionsID;
70static jfieldID have_OES_blend_equation_separateID;
71static jfieldID have_OES_blend_subtractID;
72static jfieldID have_OES_framebuffer_objectID;
73static jfieldID have_OES_texture_cube_mapID;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080074
75/* Cache method IDs each time the class is loaded. */
76
Jack Palevich27f80022009-04-15 19:13:17 -070077static void
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070078nativeClassInit(JNIEnv *_env, jclass glImplClass)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080079{
Jack Palevich91a27ae2009-06-15 21:03:24 -070080 jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl");
81 G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal);
Jack Palevich8a4de4b2010-01-28 20:28:32 +080082 haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z");
83 have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z");
84 have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z");
85 have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z");
86 have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z");
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080087}
88
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080089static void *
Thomas Tafertshofer17045a12012-07-12 13:55:55 -070090getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080091{
92 jint position;
93 jint limit;
94 jint elementSizeShift;
95 jlong pointer;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080096
Orion Hodson617835922019-02-28 15:15:34 +000097 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080098 *remaining = (limit - position) << elementSizeShift;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080099 if (pointer != 0L) {
Orion Hodson617835922019-02-28 15:15:34 +0000100 *array = nullptr;
101 pointer += position << elementSizeShift;
102 return reinterpret_cast<void*>(pointer);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800103 }
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700104
Orion Hodson617835922019-02-28 15:15:34 +0000105 *array = jniGetNioBufferBaseArray(_env, buffer);
106 *offset = jniGetNioBufferBaseArrayOffset(_env, buffer);
107 return nullptr;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800108}
109
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800110static void
111releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
112{
113 _env->ReleasePrimitiveArrayCritical(array, data,
114 commit ? 0 : JNI_ABORT);
115}
116
Jack Palevich91a27ae2009-06-15 21:03:24 -0700117extern "C" {
118extern char* __progname;
119}
120
Jack Palevich16e79722009-05-15 18:13:34 -0700121static void *
122getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
Orion Hodson617835922019-02-28 15:15:34 +0000123 if (buffer == nullptr) {
124 return nullptr;
Jack Palevich91a27ae2009-06-15 21:03:24 -0700125 }
Orion Hodson617835922019-02-28 15:15:34 +0000126
127 jint position;
128 jint limit;
129 jint elementSizeShift;
130 jlong pointer;
131 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
132 if (pointer == 0) {
133 jniThrowException(_env, "java/lang/IllegalArgumentException",
134 "Must use a native order direct Buffer");
135 return nullptr;
Jack Palevich16e79722009-05-15 18:13:34 -0700136 }
Orion Hodson617835922019-02-28 15:15:34 +0000137 pointer += position << elementSizeShift;
138 return reinterpret_cast<void*>(pointer);
Jack Palevich16e79722009-05-15 18:13:34 -0700139}
140
Jack Palevichbe509c92009-05-07 09:52:14 -0700141static int
142getNumCompressedTextureFormats() {
143 int numCompressedTextureFormats = 0;
144 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
145 return numCompressedTextureFormats;
146}
147
Jack Palevich8a4de4b2010-01-28 20:28:32 +0800148// Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is
149// terminated by either 0 or space, while pExtension is terminated by 0.
150
151static bool
152extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) {
153 while (true) {
154 char a = *pExtensions++;
155 char b = *pExtension++;
156 bool aEnd = a == '\0' || a == ' ';
157 bool bEnd = b == '\0';
158 if ( aEnd || bEnd) {
159 return aEnd == bEnd;
160 }
161 if ( a != b ) {
162 return false;
163 }
164 }
165}
166
167static const GLubyte*
168nextExtension(const GLubyte* pExtensions) {
169 while (true) {
170 char a = *pExtensions++;
171 if ( a == '\0') {
172 return pExtensions-1;
173 } else if ( a == ' ') {
174 return pExtensions;
175 }
176 }
177}
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700178
Jack Palevich8a4de4b2010-01-28 20:28:32 +0800179static bool
180checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) {
181 for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) {
182 if (extensionEqual(pExtensions, pExtension)) {
183 return true;
184 }
185 }
186 return false;
187}
188
189static bool
190supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) {
191 if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) {
192 _env->SetBooleanField(impl, haveCheckedExtensionsID, true);
193 const GLubyte* sExtensions = glGetString(GL_EXTENSIONS);
194 _env->SetBooleanField(impl, have_OES_blend_equation_separateID,
195 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate"));
196 _env->SetBooleanField(impl, have_OES_blend_subtractID,
197 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract"));
198 _env->SetBooleanField(impl, have_OES_framebuffer_objectID,
199 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object"));
200 _env->SetBooleanField(impl, have_OES_texture_cube_mapID,
201 checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map"));
202 }
203 return _env->GetBooleanField(impl, fieldId);
204}
205
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800206// --------------------------------------------------------------------------
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800207/* void glActiveTexture ( GLenum texture ) */
208static void
209android_glActiveTexture__I
210 (JNIEnv *_env, jobject _this, jint texture) {
211 glActiveTexture(
212 (GLenum)texture
213 );
214}
215
216/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
217static void
218android_glAlphaFunc__IF
219 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
220 glAlphaFunc(
221 (GLenum)func,
222 (GLclampf)ref
223 );
224}
225
226/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
227static void
228android_glAlphaFuncx__II
229 (JNIEnv *_env, jobject _this, jint func, jint ref) {
230 glAlphaFuncx(
231 (GLenum)func,
232 (GLclampx)ref
233 );
234}
235
236/* void glBindTexture ( GLenum target, GLuint texture ) */
237static void
238android_glBindTexture__II
239 (JNIEnv *_env, jobject _this, jint target, jint texture) {
240 glBindTexture(
241 (GLenum)target,
242 (GLuint)texture
243 );
244}
245
246/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
247static void
248android_glBlendFunc__II
249 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
250 glBlendFunc(
251 (GLenum)sfactor,
252 (GLenum)dfactor
253 );
254}
255
256/* void glClear ( GLbitfield mask ) */
257static void
258android_glClear__I
259 (JNIEnv *_env, jobject _this, jint mask) {
260 glClear(
261 (GLbitfield)mask
262 );
263}
264
265/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
266static void
267android_glClearColor__FFFF
268 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
269 glClearColor(
270 (GLclampf)red,
271 (GLclampf)green,
272 (GLclampf)blue,
273 (GLclampf)alpha
274 );
275}
276
277/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
278static void
279android_glClearColorx__IIII
280 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
281 glClearColorx(
282 (GLclampx)red,
283 (GLclampx)green,
284 (GLclampx)blue,
285 (GLclampx)alpha
286 );
287}
288
289/* void glClearDepthf ( GLclampf depth ) */
290static void
291android_glClearDepthf__F
292 (JNIEnv *_env, jobject _this, jfloat depth) {
293 glClearDepthf(
294 (GLclampf)depth
295 );
296}
297
298/* void glClearDepthx ( GLclampx depth ) */
299static void
300android_glClearDepthx__I
301 (JNIEnv *_env, jobject _this, jint depth) {
302 glClearDepthx(
303 (GLclampx)depth
304 );
305}
306
307/* void glClearStencil ( GLint s ) */
308static void
309android_glClearStencil__I
310 (JNIEnv *_env, jobject _this, jint s) {
311 glClearStencil(
312 (GLint)s
313 );
314}
315
316/* void glClientActiveTexture ( GLenum texture ) */
317static void
318android_glClientActiveTexture__I
319 (JNIEnv *_env, jobject _this, jint texture) {
320 glClientActiveTexture(
321 (GLenum)texture
322 );
323}
324
325/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
326static void
327android_glColor4f__FFFF
328 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
329 glColor4f(
330 (GLfloat)red,
331 (GLfloat)green,
332 (GLfloat)blue,
333 (GLfloat)alpha
334 );
335}
336
337/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
338static void
339android_glColor4x__IIII
340 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
341 glColor4x(
342 (GLfixed)red,
343 (GLfixed)green,
344 (GLfixed)blue,
345 (GLfixed)alpha
346 );
347}
348
349/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
350static void
351android_glColorMask__ZZZZ
352 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
353 glColorMask(
354 (GLboolean)red,
355 (GLboolean)green,
356 (GLboolean)blue,
357 (GLboolean)alpha
358 );
359}
360
361/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
362static void
363android_glColorPointerBounds__IIILjava_nio_Buffer_2I
364 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -0800365 jint _exception = 0;
366 const char * _exceptionType = NULL;
367 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800368 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700369 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800370 jint _remaining;
371 GLvoid *pointer = (GLvoid *) 0;
372
Jack Paleviche20ea782009-05-07 18:28:29 -0700373 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -0700374 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -0700375 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -0700376 return;
377 }
378 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800379 glColorPointerBounds(
380 (GLint)size,
381 (GLenum)type,
382 (GLsizei)stride,
383 (GLvoid *)pointer,
384 (GLsizei)remaining
385 );
Romain Guy84cac202016-12-05 12:26:02 -0800386 if (_exception) {
387 jniThrowException(_env, _exceptionType, _exceptionMessage);
388 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800389}
390
391/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
392static void
393android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
394 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800395 jint _exception = 0;
396 const char * _exceptionType = NULL;
397 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800398 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700399 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800400 jint _remaining;
401 GLvoid *data = (GLvoid *) 0;
402
Romain Guy84cac202016-12-05 12:26:02 -0800403 if (!data_buf) {
404 _exception = 1;
405 _exceptionType = "java/lang/IllegalArgumentException";
406 _exceptionMessage = "data == null";
407 goto exit;
408 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700409 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700410 if (data == NULL) {
411 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
412 data = (GLvoid *) (_dataBase + _bufferOffset);
413 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800414 glCompressedTexImage2D(
415 (GLenum)target,
416 (GLint)level,
417 (GLenum)internalformat,
418 (GLsizei)width,
419 (GLsizei)height,
420 (GLint)border,
421 (GLsizei)imageSize,
422 (GLvoid *)data
423 );
Romain Guy84cac202016-12-05 12:26:02 -0800424
425exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800426 if (_array) {
427 releasePointer(_env, _array, data, JNI_FALSE);
428 }
Romain Guy84cac202016-12-05 12:26:02 -0800429 if (_exception) {
430 jniThrowException(_env, _exceptionType, _exceptionMessage);
431 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800432}
433
434/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
435static void
436android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
437 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800438 jint _exception = 0;
439 const char * _exceptionType = NULL;
440 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800441 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700442 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800443 jint _remaining;
444 GLvoid *data = (GLvoid *) 0;
445
Romain Guy84cac202016-12-05 12:26:02 -0800446 if (!data_buf) {
447 _exception = 1;
448 _exceptionType = "java/lang/IllegalArgumentException";
449 _exceptionMessage = "data == null";
450 goto exit;
451 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700452 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700453 if (data == NULL) {
454 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
455 data = (GLvoid *) (_dataBase + _bufferOffset);
456 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800457 glCompressedTexSubImage2D(
458 (GLenum)target,
459 (GLint)level,
460 (GLint)xoffset,
461 (GLint)yoffset,
462 (GLsizei)width,
463 (GLsizei)height,
464 (GLenum)format,
465 (GLsizei)imageSize,
466 (GLvoid *)data
467 );
Romain Guy84cac202016-12-05 12:26:02 -0800468
469exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800470 if (_array) {
471 releasePointer(_env, _array, data, JNI_FALSE);
472 }
Romain Guy84cac202016-12-05 12:26:02 -0800473 if (_exception) {
474 jniThrowException(_env, _exceptionType, _exceptionMessage);
475 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800476}
477
478/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
479static void
480android_glCopyTexImage2D__IIIIIIII
481 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
482 glCopyTexImage2D(
483 (GLenum)target,
484 (GLint)level,
485 (GLenum)internalformat,
486 (GLint)x,
487 (GLint)y,
488 (GLsizei)width,
489 (GLsizei)height,
490 (GLint)border
491 );
492}
493
494/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
495static void
496android_glCopyTexSubImage2D__IIIIIIII
497 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
498 glCopyTexSubImage2D(
499 (GLenum)target,
500 (GLint)level,
501 (GLint)xoffset,
502 (GLint)yoffset,
503 (GLint)x,
504 (GLint)y,
505 (GLsizei)width,
506 (GLsizei)height
507 );
508}
509
510/* void glCullFace ( GLenum mode ) */
511static void
512android_glCullFace__I
513 (JNIEnv *_env, jobject _this, jint mode) {
514 glCullFace(
515 (GLenum)mode
516 );
517}
518
519/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
520static void
521android_glDeleteTextures__I_3II
522 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700523 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800524 const char * _exceptionType = NULL;
525 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800526 GLuint *textures_base = (GLuint *) 0;
527 jint _remaining;
528 GLuint *textures = (GLuint *) 0;
529
530 if (!textures_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700531 _exception = 1;
532 _exceptionType = "java/lang/IllegalArgumentException";
533 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800534 goto exit;
535 }
536 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700537 _exception = 1;
538 _exceptionType = "java/lang/IllegalArgumentException";
539 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800540 goto exit;
541 }
542 _remaining = _env->GetArrayLength(textures_ref) - offset;
543 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700544 _exception = 1;
545 _exceptionType = "java/lang/IllegalArgumentException";
546 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800547 goto exit;
548 }
549 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700550 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800551 textures = textures_base + offset;
552
553 glDeleteTextures(
554 (GLsizei)n,
555 (GLuint *)textures
556 );
557
558exit:
559 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700560 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800561 JNI_ABORT);
562 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700563 if (_exception) {
564 jniThrowException(_env, _exceptionType, _exceptionMessage);
565 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800566}
567
568/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
569static void
570android_glDeleteTextures__ILjava_nio_IntBuffer_2
571 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700572 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800573 const char * _exceptionType = NULL;
574 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700575 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700576 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800577 jint _remaining;
578 GLuint *textures = (GLuint *) 0;
579
Romain Guy84cac202016-12-05 12:26:02 -0800580 if (!textures_buf) {
581 _exception = 1;
582 _exceptionType = "java/lang/IllegalArgumentException";
583 _exceptionMessage = "textures == null";
584 goto exit;
585 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700586 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800587 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700588 _exception = 1;
589 _exceptionType = "java/lang/IllegalArgumentException";
590 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800591 goto exit;
592 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700593 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700594 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700595 textures = (GLuint *) (_texturesBase + _bufferOffset);
596 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800597 glDeleteTextures(
598 (GLsizei)n,
599 (GLuint *)textures
600 );
601
602exit:
603 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700604 _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800605 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700606 if (_exception) {
607 jniThrowException(_env, _exceptionType, _exceptionMessage);
608 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800609}
610
611/* void glDepthFunc ( GLenum func ) */
612static void
613android_glDepthFunc__I
614 (JNIEnv *_env, jobject _this, jint func) {
615 glDepthFunc(
616 (GLenum)func
617 );
618}
619
620/* void glDepthMask ( GLboolean flag ) */
621static void
622android_glDepthMask__Z
623 (JNIEnv *_env, jobject _this, jboolean flag) {
624 glDepthMask(
625 (GLboolean)flag
626 );
627}
628
629/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
630static void
631android_glDepthRangef__FF
632 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
633 glDepthRangef(
634 (GLclampf)zNear,
635 (GLclampf)zFar
636 );
637}
638
639/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
640static void
641android_glDepthRangex__II
642 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
643 glDepthRangex(
644 (GLclampx)zNear,
645 (GLclampx)zFar
646 );
647}
648
649/* void glDisable ( GLenum cap ) */
650static void
651android_glDisable__I
652 (JNIEnv *_env, jobject _this, jint cap) {
653 glDisable(
654 (GLenum)cap
655 );
656}
657
658/* void glDisableClientState ( GLenum array ) */
659static void
660android_glDisableClientState__I
661 (JNIEnv *_env, jobject _this, jint array) {
662 glDisableClientState(
663 (GLenum)array
664 );
665}
666
667/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
668static void
669android_glDrawArrays__III
670 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
671 glDrawArrays(
672 (GLenum)mode,
673 (GLint)first,
674 (GLsizei)count
675 );
676}
677
678/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
679static void
680android_glDrawElements__IIILjava_nio_Buffer_2
681 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700682 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800683 const char * _exceptionType = NULL;
684 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800685 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700686 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800687 jint _remaining;
688 GLvoid *indices = (GLvoid *) 0;
689
Romain Guy84cac202016-12-05 12:26:02 -0800690 if (!indices_buf) {
691 _exception = 1;
692 _exceptionType = "java/lang/IllegalArgumentException";
693 _exceptionMessage = "indices == null";
694 goto exit;
695 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700696 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800697 if (_remaining < count) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700698 _exception = 1;
699 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
700 _exceptionMessage = "remaining() < count < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800701 goto exit;
702 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700703 if (indices == NULL) {
704 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
705 indices = (GLvoid *) (_indicesBase + _bufferOffset);
706 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800707 glDrawElements(
708 (GLenum)mode,
709 (GLsizei)count,
710 (GLenum)type,
711 (GLvoid *)indices
712 );
713
714exit:
715 if (_array) {
716 releasePointer(_env, _array, indices, JNI_FALSE);
717 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700718 if (_exception) {
719 jniThrowException(_env, _exceptionType, _exceptionMessage);
720 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800721}
722
723/* void glEnable ( GLenum cap ) */
724static void
725android_glEnable__I
726 (JNIEnv *_env, jobject _this, jint cap) {
727 glEnable(
728 (GLenum)cap
729 );
730}
731
732/* void glEnableClientState ( GLenum array ) */
733static void
734android_glEnableClientState__I
735 (JNIEnv *_env, jobject _this, jint array) {
736 glEnableClientState(
737 (GLenum)array
738 );
739}
740
741/* void glFinish ( void ) */
742static void
743android_glFinish__
744 (JNIEnv *_env, jobject _this) {
745 glFinish();
746}
747
748/* void glFlush ( void ) */
749static void
750android_glFlush__
751 (JNIEnv *_env, jobject _this) {
752 glFlush();
753}
754
755/* void glFogf ( GLenum pname, GLfloat param ) */
756static void
757android_glFogf__IF
758 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
759 glFogf(
760 (GLenum)pname,
761 (GLfloat)param
762 );
763}
764
765/* void glFogfv ( GLenum pname, const GLfloat *params ) */
766static void
767android_glFogfv__I_3FI
768 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700769 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800770 const char * _exceptionType = NULL;
771 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800772 GLfloat *params_base = (GLfloat *) 0;
773 jint _remaining;
774 GLfloat *params = (GLfloat *) 0;
775
776 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700777 _exception = 1;
778 _exceptionType = "java/lang/IllegalArgumentException";
779 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800780 goto exit;
781 }
782 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700783 _exception = 1;
784 _exceptionType = "java/lang/IllegalArgumentException";
785 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800786 goto exit;
787 }
788 _remaining = _env->GetArrayLength(params_ref) - offset;
789 int _needed;
790 switch (pname) {
791#if defined(GL_FOG_MODE)
792 case GL_FOG_MODE:
793#endif // defined(GL_FOG_MODE)
794#if defined(GL_FOG_DENSITY)
795 case GL_FOG_DENSITY:
796#endif // defined(GL_FOG_DENSITY)
797#if defined(GL_FOG_START)
798 case GL_FOG_START:
799#endif // defined(GL_FOG_START)
800#if defined(GL_FOG_END)
801 case GL_FOG_END:
802#endif // defined(GL_FOG_END)
803 _needed = 1;
804 break;
805#if defined(GL_FOG_COLOR)
806 case GL_FOG_COLOR:
807#endif // defined(GL_FOG_COLOR)
808 _needed = 4;
809 break;
810 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800811 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800812 break;
813 }
814 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700815 _exception = 1;
816 _exceptionType = "java/lang/IllegalArgumentException";
817 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800818 goto exit;
819 }
820 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700821 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800822 params = params_base + offset;
823
824 glFogfv(
825 (GLenum)pname,
826 (GLfloat *)params
827 );
828
829exit:
830 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700831 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800832 JNI_ABORT);
833 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700834 if (_exception) {
835 jniThrowException(_env, _exceptionType, _exceptionMessage);
836 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800837}
838
839/* void glFogfv ( GLenum pname, const GLfloat *params ) */
840static void
841android_glFogfv__ILjava_nio_FloatBuffer_2
842 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700843 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800844 const char * _exceptionType = NULL;
845 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700846 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700847 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800848 jint _remaining;
849 GLfloat *params = (GLfloat *) 0;
850
Romain Guy84cac202016-12-05 12:26:02 -0800851 if (!params_buf) {
852 _exception = 1;
853 _exceptionType = "java/lang/IllegalArgumentException";
854 _exceptionMessage = "params == null";
855 goto exit;
856 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700857 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800858 int _needed;
859 switch (pname) {
860#if defined(GL_FOG_MODE)
861 case GL_FOG_MODE:
862#endif // defined(GL_FOG_MODE)
863#if defined(GL_FOG_DENSITY)
864 case GL_FOG_DENSITY:
865#endif // defined(GL_FOG_DENSITY)
866#if defined(GL_FOG_START)
867 case GL_FOG_START:
868#endif // defined(GL_FOG_START)
869#if defined(GL_FOG_END)
870 case GL_FOG_END:
871#endif // defined(GL_FOG_END)
872 _needed = 1;
873 break;
874#if defined(GL_FOG_COLOR)
875 case GL_FOG_COLOR:
876#endif // defined(GL_FOG_COLOR)
877 _needed = 4;
878 break;
879 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800880 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800881 break;
882 }
883 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700884 _exception = 1;
885 _exceptionType = "java/lang/IllegalArgumentException";
886 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800887 goto exit;
888 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700889 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700890 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700891 params = (GLfloat *) (_paramsBase + _bufferOffset);
892 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800893 glFogfv(
894 (GLenum)pname,
895 (GLfloat *)params
896 );
897
898exit:
899 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700900 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800901 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700902 if (_exception) {
903 jniThrowException(_env, _exceptionType, _exceptionMessage);
904 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800905}
906
907/* void glFogx ( GLenum pname, GLfixed param ) */
908static void
909android_glFogx__II
910 (JNIEnv *_env, jobject _this, jint pname, jint param) {
911 glFogx(
912 (GLenum)pname,
913 (GLfixed)param
914 );
915}
916
917/* void glFogxv ( GLenum pname, const GLfixed *params ) */
918static void
919android_glFogxv__I_3II
920 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700921 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800922 const char * _exceptionType = NULL;
923 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800924 GLfixed *params_base = (GLfixed *) 0;
925 jint _remaining;
926 GLfixed *params = (GLfixed *) 0;
927
928 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700929 _exception = 1;
930 _exceptionType = "java/lang/IllegalArgumentException";
931 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800932 goto exit;
933 }
934 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700935 _exception = 1;
936 _exceptionType = "java/lang/IllegalArgumentException";
937 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800938 goto exit;
939 }
940 _remaining = _env->GetArrayLength(params_ref) - offset;
941 int _needed;
942 switch (pname) {
943#if defined(GL_FOG_MODE)
944 case GL_FOG_MODE:
945#endif // defined(GL_FOG_MODE)
946#if defined(GL_FOG_DENSITY)
947 case GL_FOG_DENSITY:
948#endif // defined(GL_FOG_DENSITY)
949#if defined(GL_FOG_START)
950 case GL_FOG_START:
951#endif // defined(GL_FOG_START)
952#if defined(GL_FOG_END)
953 case GL_FOG_END:
954#endif // defined(GL_FOG_END)
955 _needed = 1;
956 break;
957#if defined(GL_FOG_COLOR)
958 case GL_FOG_COLOR:
959#endif // defined(GL_FOG_COLOR)
960 _needed = 4;
961 break;
962 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800963 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800964 break;
965 }
966 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700967 _exception = 1;
968 _exceptionType = "java/lang/IllegalArgumentException";
969 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800970 goto exit;
971 }
972 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700973 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800974 params = params_base + offset;
975
976 glFogxv(
977 (GLenum)pname,
978 (GLfixed *)params
979 );
980
981exit:
982 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700983 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800984 JNI_ABORT);
985 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700986 if (_exception) {
987 jniThrowException(_env, _exceptionType, _exceptionMessage);
988 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800989}
990
991/* void glFogxv ( GLenum pname, const GLfixed *params ) */
992static void
993android_glFogxv__ILjava_nio_IntBuffer_2
994 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700995 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800996 const char * _exceptionType = NULL;
997 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700998 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700999 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001000 jint _remaining;
1001 GLfixed *params = (GLfixed *) 0;
1002
Romain Guy84cac202016-12-05 12:26:02 -08001003 if (!params_buf) {
1004 _exception = 1;
1005 _exceptionType = "java/lang/IllegalArgumentException";
1006 _exceptionMessage = "params == null";
1007 goto exit;
1008 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001009 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001010 int _needed;
1011 switch (pname) {
1012#if defined(GL_FOG_MODE)
1013 case GL_FOG_MODE:
1014#endif // defined(GL_FOG_MODE)
1015#if defined(GL_FOG_DENSITY)
1016 case GL_FOG_DENSITY:
1017#endif // defined(GL_FOG_DENSITY)
1018#if defined(GL_FOG_START)
1019 case GL_FOG_START:
1020#endif // defined(GL_FOG_START)
1021#if defined(GL_FOG_END)
1022 case GL_FOG_END:
1023#endif // defined(GL_FOG_END)
1024 _needed = 1;
1025 break;
1026#if defined(GL_FOG_COLOR)
1027 case GL_FOG_COLOR:
1028#endif // defined(GL_FOG_COLOR)
1029 _needed = 4;
1030 break;
1031 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001032 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001033 break;
1034 }
1035 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001036 _exception = 1;
1037 _exceptionType = "java/lang/IllegalArgumentException";
1038 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001039 goto exit;
1040 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001041 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001042 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001043 params = (GLfixed *) (_paramsBase + _bufferOffset);
1044 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001045 glFogxv(
1046 (GLenum)pname,
1047 (GLfixed *)params
1048 );
1049
1050exit:
1051 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001052 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001053 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001054 if (_exception) {
1055 jniThrowException(_env, _exceptionType, _exceptionMessage);
1056 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001057}
1058
1059/* void glFrontFace ( GLenum mode ) */
1060static void
1061android_glFrontFace__I
1062 (JNIEnv *_env, jobject _this, jint mode) {
1063 glFrontFace(
1064 (GLenum)mode
1065 );
1066}
1067
1068/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1069static void
1070android_glFrustumf__FFFFFF
1071 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1072 glFrustumf(
1073 (GLfloat)left,
1074 (GLfloat)right,
1075 (GLfloat)bottom,
1076 (GLfloat)top,
1077 (GLfloat)zNear,
1078 (GLfloat)zFar
1079 );
1080}
1081
1082/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1083static void
1084android_glFrustumx__IIIIII
1085 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1086 glFrustumx(
1087 (GLfixed)left,
1088 (GLfixed)right,
1089 (GLfixed)bottom,
1090 (GLfixed)top,
1091 (GLfixed)zNear,
1092 (GLfixed)zFar
1093 );
1094}
1095
1096/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1097static void
1098android_glGenTextures__I_3II
1099 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1100 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001101 const char * _exceptionType = NULL;
1102 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001103 GLuint *textures_base = (GLuint *) 0;
1104 jint _remaining;
1105 GLuint *textures = (GLuint *) 0;
1106
1107 if (!textures_ref) {
1108 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001109 _exceptionType = "java/lang/IllegalArgumentException";
1110 _exceptionMessage = "textures == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001111 goto exit;
1112 }
1113 if (offset < 0) {
1114 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001115 _exceptionType = "java/lang/IllegalArgumentException";
1116 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001117 goto exit;
1118 }
1119 _remaining = _env->GetArrayLength(textures_ref) - offset;
1120 if (_remaining < n) {
1121 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001122 _exceptionType = "java/lang/IllegalArgumentException";
1123 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001124 goto exit;
1125 }
1126 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001127 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001128 textures = textures_base + offset;
1129
1130 glGenTextures(
1131 (GLsizei)n,
1132 (GLuint *)textures
1133 );
1134
1135exit:
1136 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001137 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001138 _exception ? JNI_ABORT: 0);
1139 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001140 if (_exception) {
1141 jniThrowException(_env, _exceptionType, _exceptionMessage);
1142 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001143}
1144
1145/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1146static void
1147android_glGenTextures__ILjava_nio_IntBuffer_2
1148 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1149 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001150 const char * _exceptionType = NULL;
1151 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001152 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001153 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001154 jint _remaining;
1155 GLuint *textures = (GLuint *) 0;
1156
Romain Guy84cac202016-12-05 12:26:02 -08001157 if (!textures_buf) {
1158 _exception = 1;
1159 _exceptionType = "java/lang/IllegalArgumentException";
1160 _exceptionMessage = "textures == null";
1161 goto exit;
1162 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001163 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001164 if (_remaining < n) {
1165 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001166 _exceptionType = "java/lang/IllegalArgumentException";
1167 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001168 goto exit;
1169 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001170 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001171 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001172 textures = (GLuint *) (_texturesBase + _bufferOffset);
1173 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001174 glGenTextures(
1175 (GLsizei)n,
1176 (GLuint *)textures
1177 );
1178
1179exit:
1180 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001181 _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001182 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001183 if (_exception) {
1184 jniThrowException(_env, _exceptionType, _exceptionMessage);
1185 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001186}
1187
1188/* GLenum glGetError ( void ) */
1189static jint
1190android_glGetError__
1191 (JNIEnv *_env, jobject _this) {
1192 GLenum _returnValue;
1193 _returnValue = glGetError();
Elliott Hughes428d3fc2013-09-24 17:15:41 -07001194 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001195}
1196
1197/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1198static void
1199android_glGetIntegerv__I_3II
1200 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1201 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001202 const char * _exceptionType = NULL;
1203 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001204 GLint *params_base = (GLint *) 0;
1205 jint _remaining;
1206 GLint *params = (GLint *) 0;
1207
1208 if (!params_ref) {
1209 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001210 _exceptionType = "java/lang/IllegalArgumentException";
1211 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001212 goto exit;
1213 }
1214 if (offset < 0) {
1215 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001216 _exceptionType = "java/lang/IllegalArgumentException";
1217 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001218 goto exit;
1219 }
1220 _remaining = _env->GetArrayLength(params_ref) - offset;
1221 int _needed;
1222 switch (pname) {
1223#if defined(GL_ALPHA_BITS)
1224 case GL_ALPHA_BITS:
1225#endif // defined(GL_ALPHA_BITS)
1226#if defined(GL_ALPHA_TEST_FUNC)
1227 case GL_ALPHA_TEST_FUNC:
1228#endif // defined(GL_ALPHA_TEST_FUNC)
1229#if defined(GL_ALPHA_TEST_REF)
1230 case GL_ALPHA_TEST_REF:
1231#endif // defined(GL_ALPHA_TEST_REF)
1232#if defined(GL_BLEND_DST)
1233 case GL_BLEND_DST:
1234#endif // defined(GL_BLEND_DST)
1235#if defined(GL_BLUE_BITS)
1236 case GL_BLUE_BITS:
1237#endif // defined(GL_BLUE_BITS)
1238#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1239 case GL_COLOR_ARRAY_BUFFER_BINDING:
1240#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1241#if defined(GL_COLOR_ARRAY_SIZE)
1242 case GL_COLOR_ARRAY_SIZE:
1243#endif // defined(GL_COLOR_ARRAY_SIZE)
1244#if defined(GL_COLOR_ARRAY_STRIDE)
1245 case GL_COLOR_ARRAY_STRIDE:
1246#endif // defined(GL_COLOR_ARRAY_STRIDE)
1247#if defined(GL_COLOR_ARRAY_TYPE)
1248 case GL_COLOR_ARRAY_TYPE:
1249#endif // defined(GL_COLOR_ARRAY_TYPE)
1250#if defined(GL_CULL_FACE)
1251 case GL_CULL_FACE:
1252#endif // defined(GL_CULL_FACE)
1253#if defined(GL_DEPTH_BITS)
1254 case GL_DEPTH_BITS:
1255#endif // defined(GL_DEPTH_BITS)
1256#if defined(GL_DEPTH_CLEAR_VALUE)
1257 case GL_DEPTH_CLEAR_VALUE:
1258#endif // defined(GL_DEPTH_CLEAR_VALUE)
1259#if defined(GL_DEPTH_FUNC)
1260 case GL_DEPTH_FUNC:
1261#endif // defined(GL_DEPTH_FUNC)
1262#if defined(GL_DEPTH_WRITEMASK)
1263 case GL_DEPTH_WRITEMASK:
1264#endif // defined(GL_DEPTH_WRITEMASK)
1265#if defined(GL_FOG_DENSITY)
1266 case GL_FOG_DENSITY:
1267#endif // defined(GL_FOG_DENSITY)
1268#if defined(GL_FOG_END)
1269 case GL_FOG_END:
1270#endif // defined(GL_FOG_END)
1271#if defined(GL_FOG_MODE)
1272 case GL_FOG_MODE:
1273#endif // defined(GL_FOG_MODE)
1274#if defined(GL_FOG_START)
1275 case GL_FOG_START:
1276#endif // defined(GL_FOG_START)
1277#if defined(GL_FRONT_FACE)
1278 case GL_FRONT_FACE:
1279#endif // defined(GL_FRONT_FACE)
1280#if defined(GL_GREEN_BITS)
1281 case GL_GREEN_BITS:
1282#endif // defined(GL_GREEN_BITS)
1283#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1284 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1285#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1286#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1287 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1288#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001289#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1290 case GL_LIGHT_MODEL_COLOR_CONTROL:
1291#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1292#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1293 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1294#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001295#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1296 case GL_LIGHT_MODEL_TWO_SIDE:
1297#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1298#if defined(GL_LINE_SMOOTH_HINT)
1299 case GL_LINE_SMOOTH_HINT:
1300#endif // defined(GL_LINE_SMOOTH_HINT)
1301#if defined(GL_LINE_WIDTH)
1302 case GL_LINE_WIDTH:
1303#endif // defined(GL_LINE_WIDTH)
1304#if defined(GL_LOGIC_OP_MODE)
1305 case GL_LOGIC_OP_MODE:
1306#endif // defined(GL_LOGIC_OP_MODE)
1307#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1308 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1309#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1310#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1311 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1312#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1313#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1314 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1315#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1316#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1317 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1318#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1319#if defined(GL_MATRIX_MODE)
1320 case GL_MATRIX_MODE:
1321#endif // defined(GL_MATRIX_MODE)
1322#if defined(GL_MAX_CLIP_PLANES)
1323 case GL_MAX_CLIP_PLANES:
1324#endif // defined(GL_MAX_CLIP_PLANES)
1325#if defined(GL_MAX_ELEMENTS_INDICES)
1326 case GL_MAX_ELEMENTS_INDICES:
1327#endif // defined(GL_MAX_ELEMENTS_INDICES)
1328#if defined(GL_MAX_ELEMENTS_VERTICES)
1329 case GL_MAX_ELEMENTS_VERTICES:
1330#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1331#if defined(GL_MAX_LIGHTS)
1332 case GL_MAX_LIGHTS:
1333#endif // defined(GL_MAX_LIGHTS)
1334#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1335 case GL_MAX_MODELVIEW_STACK_DEPTH:
1336#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1337#if defined(GL_MAX_PALETTE_MATRICES_OES)
1338 case GL_MAX_PALETTE_MATRICES_OES:
1339#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1340#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1341 case GL_MAX_PROJECTION_STACK_DEPTH:
1342#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1343#if defined(GL_MAX_TEXTURE_SIZE)
1344 case GL_MAX_TEXTURE_SIZE:
1345#endif // defined(GL_MAX_TEXTURE_SIZE)
1346#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1347 case GL_MAX_TEXTURE_STACK_DEPTH:
1348#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1349#if defined(GL_MAX_TEXTURE_UNITS)
1350 case GL_MAX_TEXTURE_UNITS:
1351#endif // defined(GL_MAX_TEXTURE_UNITS)
1352#if defined(GL_MAX_VERTEX_UNITS_OES)
1353 case GL_MAX_VERTEX_UNITS_OES:
1354#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1355#if defined(GL_MODELVIEW_STACK_DEPTH)
1356 case GL_MODELVIEW_STACK_DEPTH:
1357#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1358#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1359 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1360#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1361#if defined(GL_NORMAL_ARRAY_STRIDE)
1362 case GL_NORMAL_ARRAY_STRIDE:
1363#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1364#if defined(GL_NORMAL_ARRAY_TYPE)
1365 case GL_NORMAL_ARRAY_TYPE:
1366#endif // defined(GL_NORMAL_ARRAY_TYPE)
1367#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1368 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1369#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1370#if defined(GL_PACK_ALIGNMENT)
1371 case GL_PACK_ALIGNMENT:
1372#endif // defined(GL_PACK_ALIGNMENT)
1373#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1374 case GL_PERSPECTIVE_CORRECTION_HINT:
1375#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1376#if defined(GL_POINT_SIZE)
1377 case GL_POINT_SIZE:
1378#endif // defined(GL_POINT_SIZE)
1379#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1380 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1381#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1382#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1383 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1384#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1385#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1386 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1387#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1388#if defined(GL_POINT_SMOOTH_HINT)
1389 case GL_POINT_SMOOTH_HINT:
1390#endif // defined(GL_POINT_SMOOTH_HINT)
1391#if defined(GL_POLYGON_OFFSET_FACTOR)
1392 case GL_POLYGON_OFFSET_FACTOR:
1393#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1394#if defined(GL_POLYGON_OFFSET_UNITS)
1395 case GL_POLYGON_OFFSET_UNITS:
1396#endif // defined(GL_POLYGON_OFFSET_UNITS)
1397#if defined(GL_PROJECTION_STACK_DEPTH)
1398 case GL_PROJECTION_STACK_DEPTH:
1399#endif // defined(GL_PROJECTION_STACK_DEPTH)
1400#if defined(GL_RED_BITS)
1401 case GL_RED_BITS:
1402#endif // defined(GL_RED_BITS)
1403#if defined(GL_SHADE_MODEL)
1404 case GL_SHADE_MODEL:
1405#endif // defined(GL_SHADE_MODEL)
1406#if defined(GL_STENCIL_BITS)
1407 case GL_STENCIL_BITS:
1408#endif // defined(GL_STENCIL_BITS)
1409#if defined(GL_STENCIL_CLEAR_VALUE)
1410 case GL_STENCIL_CLEAR_VALUE:
1411#endif // defined(GL_STENCIL_CLEAR_VALUE)
1412#if defined(GL_STENCIL_FAIL)
1413 case GL_STENCIL_FAIL:
1414#endif // defined(GL_STENCIL_FAIL)
1415#if defined(GL_STENCIL_FUNC)
1416 case GL_STENCIL_FUNC:
1417#endif // defined(GL_STENCIL_FUNC)
1418#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1419 case GL_STENCIL_PASS_DEPTH_FAIL:
1420#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1421#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1422 case GL_STENCIL_PASS_DEPTH_PASS:
1423#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1424#if defined(GL_STENCIL_REF)
1425 case GL_STENCIL_REF:
1426#endif // defined(GL_STENCIL_REF)
1427#if defined(GL_STENCIL_VALUE_MASK)
1428 case GL_STENCIL_VALUE_MASK:
1429#endif // defined(GL_STENCIL_VALUE_MASK)
1430#if defined(GL_STENCIL_WRITEMASK)
1431 case GL_STENCIL_WRITEMASK:
1432#endif // defined(GL_STENCIL_WRITEMASK)
1433#if defined(GL_SUBPIXEL_BITS)
1434 case GL_SUBPIXEL_BITS:
1435#endif // defined(GL_SUBPIXEL_BITS)
1436#if defined(GL_TEXTURE_BINDING_2D)
1437 case GL_TEXTURE_BINDING_2D:
1438#endif // defined(GL_TEXTURE_BINDING_2D)
1439#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1440 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1441#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1442#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1443 case GL_TEXTURE_COORD_ARRAY_SIZE:
1444#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1445#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1446 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1447#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1448#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1449 case GL_TEXTURE_COORD_ARRAY_TYPE:
1450#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1451#if defined(GL_TEXTURE_STACK_DEPTH)
1452 case GL_TEXTURE_STACK_DEPTH:
1453#endif // defined(GL_TEXTURE_STACK_DEPTH)
1454#if defined(GL_UNPACK_ALIGNMENT)
1455 case GL_UNPACK_ALIGNMENT:
1456#endif // defined(GL_UNPACK_ALIGNMENT)
1457#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1458 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1459#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1460#if defined(GL_VERTEX_ARRAY_SIZE)
1461 case GL_VERTEX_ARRAY_SIZE:
1462#endif // defined(GL_VERTEX_ARRAY_SIZE)
1463#if defined(GL_VERTEX_ARRAY_STRIDE)
1464 case GL_VERTEX_ARRAY_STRIDE:
1465#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1466#if defined(GL_VERTEX_ARRAY_TYPE)
1467 case GL_VERTEX_ARRAY_TYPE:
1468#endif // defined(GL_VERTEX_ARRAY_TYPE)
1469#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1470 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1471#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1472#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1473 case GL_WEIGHT_ARRAY_SIZE_OES:
1474#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1475#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1476 case GL_WEIGHT_ARRAY_STRIDE_OES:
1477#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1478#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1479 case GL_WEIGHT_ARRAY_TYPE_OES:
1480#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1481 _needed = 1;
1482 break;
1483#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1484 case GL_ALIASED_POINT_SIZE_RANGE:
1485#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1486#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1487 case GL_ALIASED_LINE_WIDTH_RANGE:
1488#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1489#if defined(GL_DEPTH_RANGE)
1490 case GL_DEPTH_RANGE:
1491#endif // defined(GL_DEPTH_RANGE)
1492#if defined(GL_MAX_VIEWPORT_DIMS)
1493 case GL_MAX_VIEWPORT_DIMS:
1494#endif // defined(GL_MAX_VIEWPORT_DIMS)
1495#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1496 case GL_SMOOTH_LINE_WIDTH_RANGE:
1497#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1498#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1499 case GL_SMOOTH_POINT_SIZE_RANGE:
1500#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1501 _needed = 2;
1502 break;
1503#if defined(GL_COLOR_CLEAR_VALUE)
1504 case GL_COLOR_CLEAR_VALUE:
1505#endif // defined(GL_COLOR_CLEAR_VALUE)
1506#if defined(GL_COLOR_WRITEMASK)
1507 case GL_COLOR_WRITEMASK:
1508#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001509#if defined(GL_FOG_COLOR)
1510 case GL_FOG_COLOR:
1511#endif // defined(GL_FOG_COLOR)
1512#if defined(GL_LIGHT_MODEL_AMBIENT)
1513 case GL_LIGHT_MODEL_AMBIENT:
1514#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001515#if defined(GL_SCISSOR_BOX)
1516 case GL_SCISSOR_BOX:
1517#endif // defined(GL_SCISSOR_BOX)
1518#if defined(GL_VIEWPORT)
1519 case GL_VIEWPORT:
1520#endif // defined(GL_VIEWPORT)
1521 _needed = 4;
1522 break;
1523#if defined(GL_MODELVIEW_MATRIX)
1524 case GL_MODELVIEW_MATRIX:
1525#endif // defined(GL_MODELVIEW_MATRIX)
1526#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1527 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1528#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1529#if defined(GL_PROJECTION_MATRIX)
1530 case GL_PROJECTION_MATRIX:
1531#endif // defined(GL_PROJECTION_MATRIX)
1532#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1533 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1534#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1535#if defined(GL_TEXTURE_MATRIX)
1536 case GL_TEXTURE_MATRIX:
1537#endif // defined(GL_TEXTURE_MATRIX)
1538#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1539 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1540#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1541 _needed = 16;
1542 break;
1543#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1544 case GL_COMPRESSED_TEXTURE_FORMATS:
1545#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001546 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001547 break;
1548 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001549 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001550 break;
1551 }
1552 if (_remaining < _needed) {
1553 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001554 _exceptionType = "java/lang/IllegalArgumentException";
1555 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001556 goto exit;
1557 }
1558 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001559 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001560 params = params_base + offset;
1561
1562 glGetIntegerv(
1563 (GLenum)pname,
1564 (GLint *)params
1565 );
1566
1567exit:
1568 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001569 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001570 _exception ? JNI_ABORT: 0);
1571 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001572 if (_exception) {
1573 jniThrowException(_env, _exceptionType, _exceptionMessage);
1574 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001575}
1576
1577/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1578static void
1579android_glGetIntegerv__ILjava_nio_IntBuffer_2
1580 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1581 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001582 const char * _exceptionType = NULL;
1583 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001584 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001585 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001586 jint _remaining;
1587 GLint *params = (GLint *) 0;
1588
Romain Guy84cac202016-12-05 12:26:02 -08001589 if (!params_buf) {
1590 _exception = 1;
1591 _exceptionType = "java/lang/IllegalArgumentException";
1592 _exceptionMessage = "params == null";
1593 goto exit;
1594 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001595 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001596 int _needed;
1597 switch (pname) {
1598#if defined(GL_ALPHA_BITS)
1599 case GL_ALPHA_BITS:
1600#endif // defined(GL_ALPHA_BITS)
1601#if defined(GL_ALPHA_TEST_FUNC)
1602 case GL_ALPHA_TEST_FUNC:
1603#endif // defined(GL_ALPHA_TEST_FUNC)
1604#if defined(GL_ALPHA_TEST_REF)
1605 case GL_ALPHA_TEST_REF:
1606#endif // defined(GL_ALPHA_TEST_REF)
1607#if defined(GL_BLEND_DST)
1608 case GL_BLEND_DST:
1609#endif // defined(GL_BLEND_DST)
1610#if defined(GL_BLUE_BITS)
1611 case GL_BLUE_BITS:
1612#endif // defined(GL_BLUE_BITS)
1613#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1614 case GL_COLOR_ARRAY_BUFFER_BINDING:
1615#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1616#if defined(GL_COLOR_ARRAY_SIZE)
1617 case GL_COLOR_ARRAY_SIZE:
1618#endif // defined(GL_COLOR_ARRAY_SIZE)
1619#if defined(GL_COLOR_ARRAY_STRIDE)
1620 case GL_COLOR_ARRAY_STRIDE:
1621#endif // defined(GL_COLOR_ARRAY_STRIDE)
1622#if defined(GL_COLOR_ARRAY_TYPE)
1623 case GL_COLOR_ARRAY_TYPE:
1624#endif // defined(GL_COLOR_ARRAY_TYPE)
1625#if defined(GL_CULL_FACE)
1626 case GL_CULL_FACE:
1627#endif // defined(GL_CULL_FACE)
1628#if defined(GL_DEPTH_BITS)
1629 case GL_DEPTH_BITS:
1630#endif // defined(GL_DEPTH_BITS)
1631#if defined(GL_DEPTH_CLEAR_VALUE)
1632 case GL_DEPTH_CLEAR_VALUE:
1633#endif // defined(GL_DEPTH_CLEAR_VALUE)
1634#if defined(GL_DEPTH_FUNC)
1635 case GL_DEPTH_FUNC:
1636#endif // defined(GL_DEPTH_FUNC)
1637#if defined(GL_DEPTH_WRITEMASK)
1638 case GL_DEPTH_WRITEMASK:
1639#endif // defined(GL_DEPTH_WRITEMASK)
1640#if defined(GL_FOG_DENSITY)
1641 case GL_FOG_DENSITY:
1642#endif // defined(GL_FOG_DENSITY)
1643#if defined(GL_FOG_END)
1644 case GL_FOG_END:
1645#endif // defined(GL_FOG_END)
1646#if defined(GL_FOG_MODE)
1647 case GL_FOG_MODE:
1648#endif // defined(GL_FOG_MODE)
1649#if defined(GL_FOG_START)
1650 case GL_FOG_START:
1651#endif // defined(GL_FOG_START)
1652#if defined(GL_FRONT_FACE)
1653 case GL_FRONT_FACE:
1654#endif // defined(GL_FRONT_FACE)
1655#if defined(GL_GREEN_BITS)
1656 case GL_GREEN_BITS:
1657#endif // defined(GL_GREEN_BITS)
1658#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1659 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1660#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1661#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1662 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1663#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
Jack Palevichbe509c92009-05-07 09:52:14 -07001664#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1665 case GL_LIGHT_MODEL_COLOR_CONTROL:
1666#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1667#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1668 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1669#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001670#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1671 case GL_LIGHT_MODEL_TWO_SIDE:
1672#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1673#if defined(GL_LINE_SMOOTH_HINT)
1674 case GL_LINE_SMOOTH_HINT:
1675#endif // defined(GL_LINE_SMOOTH_HINT)
1676#if defined(GL_LINE_WIDTH)
1677 case GL_LINE_WIDTH:
1678#endif // defined(GL_LINE_WIDTH)
1679#if defined(GL_LOGIC_OP_MODE)
1680 case GL_LOGIC_OP_MODE:
1681#endif // defined(GL_LOGIC_OP_MODE)
1682#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1683 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1684#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1685#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1686 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1687#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1688#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1689 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1690#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1691#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1692 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1693#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1694#if defined(GL_MATRIX_MODE)
1695 case GL_MATRIX_MODE:
1696#endif // defined(GL_MATRIX_MODE)
1697#if defined(GL_MAX_CLIP_PLANES)
1698 case GL_MAX_CLIP_PLANES:
1699#endif // defined(GL_MAX_CLIP_PLANES)
1700#if defined(GL_MAX_ELEMENTS_INDICES)
1701 case GL_MAX_ELEMENTS_INDICES:
1702#endif // defined(GL_MAX_ELEMENTS_INDICES)
1703#if defined(GL_MAX_ELEMENTS_VERTICES)
1704 case GL_MAX_ELEMENTS_VERTICES:
1705#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1706#if defined(GL_MAX_LIGHTS)
1707 case GL_MAX_LIGHTS:
1708#endif // defined(GL_MAX_LIGHTS)
1709#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1710 case GL_MAX_MODELVIEW_STACK_DEPTH:
1711#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1712#if defined(GL_MAX_PALETTE_MATRICES_OES)
1713 case GL_MAX_PALETTE_MATRICES_OES:
1714#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1715#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1716 case GL_MAX_PROJECTION_STACK_DEPTH:
1717#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1718#if defined(GL_MAX_TEXTURE_SIZE)
1719 case GL_MAX_TEXTURE_SIZE:
1720#endif // defined(GL_MAX_TEXTURE_SIZE)
1721#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1722 case GL_MAX_TEXTURE_STACK_DEPTH:
1723#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1724#if defined(GL_MAX_TEXTURE_UNITS)
1725 case GL_MAX_TEXTURE_UNITS:
1726#endif // defined(GL_MAX_TEXTURE_UNITS)
1727#if defined(GL_MAX_VERTEX_UNITS_OES)
1728 case GL_MAX_VERTEX_UNITS_OES:
1729#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1730#if defined(GL_MODELVIEW_STACK_DEPTH)
1731 case GL_MODELVIEW_STACK_DEPTH:
1732#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1733#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1734 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1735#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1736#if defined(GL_NORMAL_ARRAY_STRIDE)
1737 case GL_NORMAL_ARRAY_STRIDE:
1738#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1739#if defined(GL_NORMAL_ARRAY_TYPE)
1740 case GL_NORMAL_ARRAY_TYPE:
1741#endif // defined(GL_NORMAL_ARRAY_TYPE)
1742#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1743 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1744#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1745#if defined(GL_PACK_ALIGNMENT)
1746 case GL_PACK_ALIGNMENT:
1747#endif // defined(GL_PACK_ALIGNMENT)
1748#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1749 case GL_PERSPECTIVE_CORRECTION_HINT:
1750#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1751#if defined(GL_POINT_SIZE)
1752 case GL_POINT_SIZE:
1753#endif // defined(GL_POINT_SIZE)
1754#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1755 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1756#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1757#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1758 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1759#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1760#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1761 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1762#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1763#if defined(GL_POINT_SMOOTH_HINT)
1764 case GL_POINT_SMOOTH_HINT:
1765#endif // defined(GL_POINT_SMOOTH_HINT)
1766#if defined(GL_POLYGON_OFFSET_FACTOR)
1767 case GL_POLYGON_OFFSET_FACTOR:
1768#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1769#if defined(GL_POLYGON_OFFSET_UNITS)
1770 case GL_POLYGON_OFFSET_UNITS:
1771#endif // defined(GL_POLYGON_OFFSET_UNITS)
1772#if defined(GL_PROJECTION_STACK_DEPTH)
1773 case GL_PROJECTION_STACK_DEPTH:
1774#endif // defined(GL_PROJECTION_STACK_DEPTH)
1775#if defined(GL_RED_BITS)
1776 case GL_RED_BITS:
1777#endif // defined(GL_RED_BITS)
1778#if defined(GL_SHADE_MODEL)
1779 case GL_SHADE_MODEL:
1780#endif // defined(GL_SHADE_MODEL)
1781#if defined(GL_STENCIL_BITS)
1782 case GL_STENCIL_BITS:
1783#endif // defined(GL_STENCIL_BITS)
1784#if defined(GL_STENCIL_CLEAR_VALUE)
1785 case GL_STENCIL_CLEAR_VALUE:
1786#endif // defined(GL_STENCIL_CLEAR_VALUE)
1787#if defined(GL_STENCIL_FAIL)
1788 case GL_STENCIL_FAIL:
1789#endif // defined(GL_STENCIL_FAIL)
1790#if defined(GL_STENCIL_FUNC)
1791 case GL_STENCIL_FUNC:
1792#endif // defined(GL_STENCIL_FUNC)
1793#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1794 case GL_STENCIL_PASS_DEPTH_FAIL:
1795#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
1796#if defined(GL_STENCIL_PASS_DEPTH_PASS)
1797 case GL_STENCIL_PASS_DEPTH_PASS:
1798#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
1799#if defined(GL_STENCIL_REF)
1800 case GL_STENCIL_REF:
1801#endif // defined(GL_STENCIL_REF)
1802#if defined(GL_STENCIL_VALUE_MASK)
1803 case GL_STENCIL_VALUE_MASK:
1804#endif // defined(GL_STENCIL_VALUE_MASK)
1805#if defined(GL_STENCIL_WRITEMASK)
1806 case GL_STENCIL_WRITEMASK:
1807#endif // defined(GL_STENCIL_WRITEMASK)
1808#if defined(GL_SUBPIXEL_BITS)
1809 case GL_SUBPIXEL_BITS:
1810#endif // defined(GL_SUBPIXEL_BITS)
1811#if defined(GL_TEXTURE_BINDING_2D)
1812 case GL_TEXTURE_BINDING_2D:
1813#endif // defined(GL_TEXTURE_BINDING_2D)
1814#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1815 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
1816#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
1817#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1818 case GL_TEXTURE_COORD_ARRAY_SIZE:
1819#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
1820#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1821 case GL_TEXTURE_COORD_ARRAY_STRIDE:
1822#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
1823#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1824 case GL_TEXTURE_COORD_ARRAY_TYPE:
1825#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
1826#if defined(GL_TEXTURE_STACK_DEPTH)
1827 case GL_TEXTURE_STACK_DEPTH:
1828#endif // defined(GL_TEXTURE_STACK_DEPTH)
1829#if defined(GL_UNPACK_ALIGNMENT)
1830 case GL_UNPACK_ALIGNMENT:
1831#endif // defined(GL_UNPACK_ALIGNMENT)
1832#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1833 case GL_VERTEX_ARRAY_BUFFER_BINDING:
1834#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
1835#if defined(GL_VERTEX_ARRAY_SIZE)
1836 case GL_VERTEX_ARRAY_SIZE:
1837#endif // defined(GL_VERTEX_ARRAY_SIZE)
1838#if defined(GL_VERTEX_ARRAY_STRIDE)
1839 case GL_VERTEX_ARRAY_STRIDE:
1840#endif // defined(GL_VERTEX_ARRAY_STRIDE)
1841#if defined(GL_VERTEX_ARRAY_TYPE)
1842 case GL_VERTEX_ARRAY_TYPE:
1843#endif // defined(GL_VERTEX_ARRAY_TYPE)
1844#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1845 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
1846#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
1847#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
1848 case GL_WEIGHT_ARRAY_SIZE_OES:
1849#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
1850#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1851 case GL_WEIGHT_ARRAY_STRIDE_OES:
1852#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
1853#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
1854 case GL_WEIGHT_ARRAY_TYPE_OES:
1855#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
1856 _needed = 1;
1857 break;
1858#if defined(GL_ALIASED_POINT_SIZE_RANGE)
1859 case GL_ALIASED_POINT_SIZE_RANGE:
1860#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
1861#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
1862 case GL_ALIASED_LINE_WIDTH_RANGE:
1863#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
1864#if defined(GL_DEPTH_RANGE)
1865 case GL_DEPTH_RANGE:
1866#endif // defined(GL_DEPTH_RANGE)
1867#if defined(GL_MAX_VIEWPORT_DIMS)
1868 case GL_MAX_VIEWPORT_DIMS:
1869#endif // defined(GL_MAX_VIEWPORT_DIMS)
1870#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1871 case GL_SMOOTH_LINE_WIDTH_RANGE:
1872#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
1873#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
1874 case GL_SMOOTH_POINT_SIZE_RANGE:
1875#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
1876 _needed = 2;
1877 break;
1878#if defined(GL_COLOR_CLEAR_VALUE)
1879 case GL_COLOR_CLEAR_VALUE:
1880#endif // defined(GL_COLOR_CLEAR_VALUE)
1881#if defined(GL_COLOR_WRITEMASK)
1882 case GL_COLOR_WRITEMASK:
1883#endif // defined(GL_COLOR_WRITEMASK)
Jack Palevichbe509c92009-05-07 09:52:14 -07001884#if defined(GL_FOG_COLOR)
1885 case GL_FOG_COLOR:
1886#endif // defined(GL_FOG_COLOR)
1887#if defined(GL_LIGHT_MODEL_AMBIENT)
1888 case GL_LIGHT_MODEL_AMBIENT:
1889#endif // defined(GL_LIGHT_MODEL_AMBIENT)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001890#if defined(GL_SCISSOR_BOX)
1891 case GL_SCISSOR_BOX:
1892#endif // defined(GL_SCISSOR_BOX)
1893#if defined(GL_VIEWPORT)
1894 case GL_VIEWPORT:
1895#endif // defined(GL_VIEWPORT)
1896 _needed = 4;
1897 break;
1898#if defined(GL_MODELVIEW_MATRIX)
1899 case GL_MODELVIEW_MATRIX:
1900#endif // defined(GL_MODELVIEW_MATRIX)
1901#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1902 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
1903#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
1904#if defined(GL_PROJECTION_MATRIX)
1905 case GL_PROJECTION_MATRIX:
1906#endif // defined(GL_PROJECTION_MATRIX)
1907#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1908 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
1909#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
1910#if defined(GL_TEXTURE_MATRIX)
1911 case GL_TEXTURE_MATRIX:
1912#endif // defined(GL_TEXTURE_MATRIX)
1913#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1914 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
1915#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
1916 _needed = 16;
1917 break;
1918#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
1919 case GL_COMPRESSED_TEXTURE_FORMATS:
1920#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
Jack Palevichbe509c92009-05-07 09:52:14 -07001921 _needed = getNumCompressedTextureFormats();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001922 break;
1923 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001924 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001925 break;
1926 }
1927 if (_remaining < _needed) {
1928 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001929 _exceptionType = "java/lang/IllegalArgumentException";
1930 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001931 goto exit;
1932 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001933 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001934 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001935 params = (GLint *) (_paramsBase + _bufferOffset);
1936 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001937 glGetIntegerv(
1938 (GLenum)pname,
1939 (GLint *)params
1940 );
1941
1942exit:
1943 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001944 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001945 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001946 if (_exception) {
1947 jniThrowException(_env, _exceptionType, _exceptionMessage);
1948 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001949}
1950
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001951/* const GLubyte * glGetString ( GLenum name ) */
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07001952static jstring android_glGetString(JNIEnv *_env, jobject, jint name) {
1953 const char* chars = (const char*) glGetString((GLenum) name);
1954 return _env->NewStringUTF(chars);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001955}
1956/* void glHint ( GLenum target, GLenum mode ) */
1957static void
1958android_glHint__II
1959 (JNIEnv *_env, jobject _this, jint target, jint mode) {
1960 glHint(
1961 (GLenum)target,
1962 (GLenum)mode
1963 );
1964}
1965
1966/* void glLightModelf ( GLenum pname, GLfloat param ) */
1967static void
1968android_glLightModelf__IF
1969 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1970 glLightModelf(
1971 (GLenum)pname,
1972 (GLfloat)param
1973 );
1974}
1975
1976/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1977static void
1978android_glLightModelfv__I_3FI
1979 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001980 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001981 const char * _exceptionType = NULL;
1982 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001983 GLfloat *params_base = (GLfloat *) 0;
1984 jint _remaining;
1985 GLfloat *params = (GLfloat *) 0;
1986
1987 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001988 _exception = 1;
1989 _exceptionType = "java/lang/IllegalArgumentException";
1990 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001991 goto exit;
1992 }
1993 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001994 _exception = 1;
1995 _exceptionType = "java/lang/IllegalArgumentException";
1996 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001997 goto exit;
1998 }
1999 _remaining = _env->GetArrayLength(params_ref) - offset;
2000 int _needed;
2001 switch (pname) {
2002#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2003 case GL_LIGHT_MODEL_TWO_SIDE:
2004#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2005 _needed = 1;
2006 break;
2007#if defined(GL_LIGHT_MODEL_AMBIENT)
2008 case GL_LIGHT_MODEL_AMBIENT:
2009#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2010 _needed = 4;
2011 break;
2012 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002013 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002014 break;
2015 }
2016 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002017 _exception = 1;
2018 _exceptionType = "java/lang/IllegalArgumentException";
2019 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002020 goto exit;
2021 }
2022 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002023 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002024 params = params_base + offset;
2025
2026 glLightModelfv(
2027 (GLenum)pname,
2028 (GLfloat *)params
2029 );
2030
2031exit:
2032 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002033 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002034 JNI_ABORT);
2035 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002036 if (_exception) {
2037 jniThrowException(_env, _exceptionType, _exceptionMessage);
2038 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002039}
2040
2041/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
2042static void
2043android_glLightModelfv__ILjava_nio_FloatBuffer_2
2044 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002045 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002046 const char * _exceptionType = NULL;
2047 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002048 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002049 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002050 jint _remaining;
2051 GLfloat *params = (GLfloat *) 0;
2052
Romain Guy84cac202016-12-05 12:26:02 -08002053 if (!params_buf) {
2054 _exception = 1;
2055 _exceptionType = "java/lang/IllegalArgumentException";
2056 _exceptionMessage = "params == null";
2057 goto exit;
2058 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002059 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002060 int _needed;
2061 switch (pname) {
2062#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2063 case GL_LIGHT_MODEL_TWO_SIDE:
2064#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2065 _needed = 1;
2066 break;
2067#if defined(GL_LIGHT_MODEL_AMBIENT)
2068 case GL_LIGHT_MODEL_AMBIENT:
2069#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2070 _needed = 4;
2071 break;
2072 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002073 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002074 break;
2075 }
2076 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002077 _exception = 1;
2078 _exceptionType = "java/lang/IllegalArgumentException";
2079 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002080 goto exit;
2081 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002082 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002083 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002084 params = (GLfloat *) (_paramsBase + _bufferOffset);
2085 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002086 glLightModelfv(
2087 (GLenum)pname,
2088 (GLfloat *)params
2089 );
2090
2091exit:
2092 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002093 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002094 }
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 glLightModelx ( GLenum pname, GLfixed param ) */
2101static void
2102android_glLightModelx__II
2103 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2104 glLightModelx(
2105 (GLenum)pname,
2106 (GLfixed)param
2107 );
2108}
2109
2110/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2111static void
2112android_glLightModelxv__I_3II
2113 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002114 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002115 const char * _exceptionType = NULL;
2116 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002117 GLfixed *params_base = (GLfixed *) 0;
2118 jint _remaining;
2119 GLfixed *params = (GLfixed *) 0;
2120
2121 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002122 _exception = 1;
2123 _exceptionType = "java/lang/IllegalArgumentException";
2124 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002125 goto exit;
2126 }
2127 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002128 _exception = 1;
2129 _exceptionType = "java/lang/IllegalArgumentException";
2130 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002131 goto exit;
2132 }
2133 _remaining = _env->GetArrayLength(params_ref) - offset;
2134 int _needed;
2135 switch (pname) {
2136#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2137 case GL_LIGHT_MODEL_TWO_SIDE:
2138#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2139 _needed = 1;
2140 break;
2141#if defined(GL_LIGHT_MODEL_AMBIENT)
2142 case GL_LIGHT_MODEL_AMBIENT:
2143#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2144 _needed = 4;
2145 break;
2146 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002147 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002148 break;
2149 }
2150 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002151 _exception = 1;
2152 _exceptionType = "java/lang/IllegalArgumentException";
2153 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002154 goto exit;
2155 }
2156 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002157 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002158 params = params_base + offset;
2159
2160 glLightModelxv(
2161 (GLenum)pname,
2162 (GLfixed *)params
2163 );
2164
2165exit:
2166 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002167 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002168 JNI_ABORT);
2169 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002170 if (_exception) {
2171 jniThrowException(_env, _exceptionType, _exceptionMessage);
2172 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002173}
2174
2175/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
2176static void
2177android_glLightModelxv__ILjava_nio_IntBuffer_2
2178 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002179 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002180 const char * _exceptionType = NULL;
2181 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002182 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002183 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002184 jint _remaining;
2185 GLfixed *params = (GLfixed *) 0;
2186
Romain Guy84cac202016-12-05 12:26:02 -08002187 if (!params_buf) {
2188 _exception = 1;
2189 _exceptionType = "java/lang/IllegalArgumentException";
2190 _exceptionMessage = "params == null";
2191 goto exit;
2192 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002193 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002194 int _needed;
2195 switch (pname) {
2196#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2197 case GL_LIGHT_MODEL_TWO_SIDE:
2198#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2199 _needed = 1;
2200 break;
2201#if defined(GL_LIGHT_MODEL_AMBIENT)
2202 case GL_LIGHT_MODEL_AMBIENT:
2203#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2204 _needed = 4;
2205 break;
2206 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002207 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002208 break;
2209 }
2210 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002211 _exception = 1;
2212 _exceptionType = "java/lang/IllegalArgumentException";
2213 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002214 goto exit;
2215 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002216 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002217 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002218 params = (GLfixed *) (_paramsBase + _bufferOffset);
2219 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002220 glLightModelxv(
2221 (GLenum)pname,
2222 (GLfixed *)params
2223 );
2224
2225exit:
2226 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002227 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002228 }
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 glLightf ( GLenum light, GLenum pname, GLfloat param ) */
2235static void
2236android_glLightf__IIF
2237 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
2238 glLightf(
2239 (GLenum)light,
2240 (GLenum)pname,
2241 (GLfloat)param
2242 );
2243}
2244
2245/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2246static void
2247android_glLightfv__II_3FI
2248 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002249 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002250 const char * _exceptionType = NULL;
2251 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002252 GLfloat *params_base = (GLfloat *) 0;
2253 jint _remaining;
2254 GLfloat *params = (GLfloat *) 0;
2255
2256 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002257 _exception = 1;
2258 _exceptionType = "java/lang/IllegalArgumentException";
2259 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002260 goto exit;
2261 }
2262 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002263 _exception = 1;
2264 _exceptionType = "java/lang/IllegalArgumentException";
2265 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002266 goto exit;
2267 }
2268 _remaining = _env->GetArrayLength(params_ref) - offset;
2269 int _needed;
2270 switch (pname) {
2271#if defined(GL_SPOT_EXPONENT)
2272 case GL_SPOT_EXPONENT:
2273#endif // defined(GL_SPOT_EXPONENT)
2274#if defined(GL_SPOT_CUTOFF)
2275 case GL_SPOT_CUTOFF:
2276#endif // defined(GL_SPOT_CUTOFF)
2277#if defined(GL_CONSTANT_ATTENUATION)
2278 case GL_CONSTANT_ATTENUATION:
2279#endif // defined(GL_CONSTANT_ATTENUATION)
2280#if defined(GL_LINEAR_ATTENUATION)
2281 case GL_LINEAR_ATTENUATION:
2282#endif // defined(GL_LINEAR_ATTENUATION)
2283#if defined(GL_QUADRATIC_ATTENUATION)
2284 case GL_QUADRATIC_ATTENUATION:
2285#endif // defined(GL_QUADRATIC_ATTENUATION)
2286 _needed = 1;
2287 break;
2288#if defined(GL_SPOT_DIRECTION)
2289 case GL_SPOT_DIRECTION:
2290#endif // defined(GL_SPOT_DIRECTION)
2291 _needed = 3;
2292 break;
2293#if defined(GL_AMBIENT)
2294 case GL_AMBIENT:
2295#endif // defined(GL_AMBIENT)
2296#if defined(GL_DIFFUSE)
2297 case GL_DIFFUSE:
2298#endif // defined(GL_DIFFUSE)
2299#if defined(GL_SPECULAR)
2300 case GL_SPECULAR:
2301#endif // defined(GL_SPECULAR)
2302#if defined(GL_EMISSION)
2303 case GL_EMISSION:
2304#endif // defined(GL_EMISSION)
2305 _needed = 4;
2306 break;
2307 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002308 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002309 break;
2310 }
2311 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002312 _exception = 1;
2313 _exceptionType = "java/lang/IllegalArgumentException";
2314 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002315 goto exit;
2316 }
2317 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002318 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002319 params = params_base + offset;
2320
2321 glLightfv(
2322 (GLenum)light,
2323 (GLenum)pname,
2324 (GLfloat *)params
2325 );
2326
2327exit:
2328 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002329 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002330 JNI_ABORT);
2331 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002332 if (_exception) {
2333 jniThrowException(_env, _exceptionType, _exceptionMessage);
2334 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002335}
2336
2337/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
2338static void
2339android_glLightfv__IILjava_nio_FloatBuffer_2
2340 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002341 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002342 const char * _exceptionType = NULL;
2343 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002344 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002345 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002346 jint _remaining;
2347 GLfloat *params = (GLfloat *) 0;
2348
Romain Guy84cac202016-12-05 12:26:02 -08002349 if (!params_buf) {
2350 _exception = 1;
2351 _exceptionType = "java/lang/IllegalArgumentException";
2352 _exceptionMessage = "params == null";
2353 goto exit;
2354 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002355 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002356 int _needed;
2357 switch (pname) {
2358#if defined(GL_SPOT_EXPONENT)
2359 case GL_SPOT_EXPONENT:
2360#endif // defined(GL_SPOT_EXPONENT)
2361#if defined(GL_SPOT_CUTOFF)
2362 case GL_SPOT_CUTOFF:
2363#endif // defined(GL_SPOT_CUTOFF)
2364#if defined(GL_CONSTANT_ATTENUATION)
2365 case GL_CONSTANT_ATTENUATION:
2366#endif // defined(GL_CONSTANT_ATTENUATION)
2367#if defined(GL_LINEAR_ATTENUATION)
2368 case GL_LINEAR_ATTENUATION:
2369#endif // defined(GL_LINEAR_ATTENUATION)
2370#if defined(GL_QUADRATIC_ATTENUATION)
2371 case GL_QUADRATIC_ATTENUATION:
2372#endif // defined(GL_QUADRATIC_ATTENUATION)
2373 _needed = 1;
2374 break;
2375#if defined(GL_SPOT_DIRECTION)
2376 case GL_SPOT_DIRECTION:
2377#endif // defined(GL_SPOT_DIRECTION)
2378 _needed = 3;
2379 break;
2380#if defined(GL_AMBIENT)
2381 case GL_AMBIENT:
2382#endif // defined(GL_AMBIENT)
2383#if defined(GL_DIFFUSE)
2384 case GL_DIFFUSE:
2385#endif // defined(GL_DIFFUSE)
2386#if defined(GL_SPECULAR)
2387 case GL_SPECULAR:
2388#endif // defined(GL_SPECULAR)
2389#if defined(GL_EMISSION)
2390 case GL_EMISSION:
2391#endif // defined(GL_EMISSION)
2392 _needed = 4;
2393 break;
2394 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002395 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002396 break;
2397 }
2398 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002399 _exception = 1;
2400 _exceptionType = "java/lang/IllegalArgumentException";
2401 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002402 goto exit;
2403 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002404 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002405 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002406 params = (GLfloat *) (_paramsBase + _bufferOffset);
2407 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002408 glLightfv(
2409 (GLenum)light,
2410 (GLenum)pname,
2411 (GLfloat *)params
2412 );
2413
2414exit:
2415 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002416 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002417 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002418 if (_exception) {
2419 jniThrowException(_env, _exceptionType, _exceptionMessage);
2420 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002421}
2422
2423/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
2424static void
2425android_glLightx__III
2426 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
2427 glLightx(
2428 (GLenum)light,
2429 (GLenum)pname,
2430 (GLfixed)param
2431 );
2432}
2433
2434/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2435static void
2436android_glLightxv__II_3II
2437 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002438 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002439 const char * _exceptionType = NULL;
2440 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002441 GLfixed *params_base = (GLfixed *) 0;
2442 jint _remaining;
2443 GLfixed *params = (GLfixed *) 0;
2444
2445 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002446 _exception = 1;
2447 _exceptionType = "java/lang/IllegalArgumentException";
2448 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002449 goto exit;
2450 }
2451 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002452 _exception = 1;
2453 _exceptionType = "java/lang/IllegalArgumentException";
2454 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002455 goto exit;
2456 }
2457 _remaining = _env->GetArrayLength(params_ref) - offset;
2458 int _needed;
2459 switch (pname) {
2460#if defined(GL_SPOT_EXPONENT)
2461 case GL_SPOT_EXPONENT:
2462#endif // defined(GL_SPOT_EXPONENT)
2463#if defined(GL_SPOT_CUTOFF)
2464 case GL_SPOT_CUTOFF:
2465#endif // defined(GL_SPOT_CUTOFF)
2466#if defined(GL_CONSTANT_ATTENUATION)
2467 case GL_CONSTANT_ATTENUATION:
2468#endif // defined(GL_CONSTANT_ATTENUATION)
2469#if defined(GL_LINEAR_ATTENUATION)
2470 case GL_LINEAR_ATTENUATION:
2471#endif // defined(GL_LINEAR_ATTENUATION)
2472#if defined(GL_QUADRATIC_ATTENUATION)
2473 case GL_QUADRATIC_ATTENUATION:
2474#endif // defined(GL_QUADRATIC_ATTENUATION)
2475 _needed = 1;
2476 break;
2477#if defined(GL_SPOT_DIRECTION)
2478 case GL_SPOT_DIRECTION:
2479#endif // defined(GL_SPOT_DIRECTION)
2480 _needed = 3;
2481 break;
2482#if defined(GL_AMBIENT)
2483 case GL_AMBIENT:
2484#endif // defined(GL_AMBIENT)
2485#if defined(GL_DIFFUSE)
2486 case GL_DIFFUSE:
2487#endif // defined(GL_DIFFUSE)
2488#if defined(GL_SPECULAR)
2489 case GL_SPECULAR:
2490#endif // defined(GL_SPECULAR)
2491#if defined(GL_EMISSION)
2492 case GL_EMISSION:
2493#endif // defined(GL_EMISSION)
2494 _needed = 4;
2495 break;
2496 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002497 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002498 break;
2499 }
2500 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002501 _exception = 1;
2502 _exceptionType = "java/lang/IllegalArgumentException";
2503 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002504 goto exit;
2505 }
2506 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002507 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002508 params = params_base + offset;
2509
2510 glLightxv(
2511 (GLenum)light,
2512 (GLenum)pname,
2513 (GLfixed *)params
2514 );
2515
2516exit:
2517 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002518 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002519 JNI_ABORT);
2520 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002521 if (_exception) {
2522 jniThrowException(_env, _exceptionType, _exceptionMessage);
2523 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002524}
2525
2526/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
2527static void
2528android_glLightxv__IILjava_nio_IntBuffer_2
2529 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002530 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002531 const char * _exceptionType = NULL;
2532 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002533 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002534 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002535 jint _remaining;
2536 GLfixed *params = (GLfixed *) 0;
2537
Romain Guy84cac202016-12-05 12:26:02 -08002538 if (!params_buf) {
2539 _exception = 1;
2540 _exceptionType = "java/lang/IllegalArgumentException";
2541 _exceptionMessage = "params == null";
2542 goto exit;
2543 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002544 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002545 int _needed;
2546 switch (pname) {
2547#if defined(GL_SPOT_EXPONENT)
2548 case GL_SPOT_EXPONENT:
2549#endif // defined(GL_SPOT_EXPONENT)
2550#if defined(GL_SPOT_CUTOFF)
2551 case GL_SPOT_CUTOFF:
2552#endif // defined(GL_SPOT_CUTOFF)
2553#if defined(GL_CONSTANT_ATTENUATION)
2554 case GL_CONSTANT_ATTENUATION:
2555#endif // defined(GL_CONSTANT_ATTENUATION)
2556#if defined(GL_LINEAR_ATTENUATION)
2557 case GL_LINEAR_ATTENUATION:
2558#endif // defined(GL_LINEAR_ATTENUATION)
2559#if defined(GL_QUADRATIC_ATTENUATION)
2560 case GL_QUADRATIC_ATTENUATION:
2561#endif // defined(GL_QUADRATIC_ATTENUATION)
2562 _needed = 1;
2563 break;
2564#if defined(GL_SPOT_DIRECTION)
2565 case GL_SPOT_DIRECTION:
2566#endif // defined(GL_SPOT_DIRECTION)
2567 _needed = 3;
2568 break;
2569#if defined(GL_AMBIENT)
2570 case GL_AMBIENT:
2571#endif // defined(GL_AMBIENT)
2572#if defined(GL_DIFFUSE)
2573 case GL_DIFFUSE:
2574#endif // defined(GL_DIFFUSE)
2575#if defined(GL_SPECULAR)
2576 case GL_SPECULAR:
2577#endif // defined(GL_SPECULAR)
2578#if defined(GL_EMISSION)
2579 case GL_EMISSION:
2580#endif // defined(GL_EMISSION)
2581 _needed = 4;
2582 break;
2583 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002584 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002585 break;
2586 }
2587 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002588 _exception = 1;
2589 _exceptionType = "java/lang/IllegalArgumentException";
2590 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002591 goto exit;
2592 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002593 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002594 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002595 params = (GLfixed *) (_paramsBase + _bufferOffset);
2596 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002597 glLightxv(
2598 (GLenum)light,
2599 (GLenum)pname,
2600 (GLfixed *)params
2601 );
2602
2603exit:
2604 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002605 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002606 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002607 if (_exception) {
2608 jniThrowException(_env, _exceptionType, _exceptionMessage);
2609 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002610}
2611
2612/* void glLineWidth ( GLfloat width ) */
2613static void
2614android_glLineWidth__F
2615 (JNIEnv *_env, jobject _this, jfloat width) {
2616 glLineWidth(
2617 (GLfloat)width
2618 );
2619}
2620
2621/* void glLineWidthx ( GLfixed width ) */
2622static void
2623android_glLineWidthx__I
2624 (JNIEnv *_env, jobject _this, jint width) {
2625 glLineWidthx(
2626 (GLfixed)width
2627 );
2628}
2629
2630/* void glLoadIdentity ( void ) */
2631static void
2632android_glLoadIdentity__
2633 (JNIEnv *_env, jobject _this) {
2634 glLoadIdentity();
2635}
2636
2637/* void glLoadMatrixf ( const GLfloat *m ) */
2638static void
2639android_glLoadMatrixf___3FI
2640 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002641 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002642 const char * _exceptionType = NULL;
2643 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002644 GLfloat *m_base = (GLfloat *) 0;
2645 jint _remaining;
2646 GLfloat *m = (GLfloat *) 0;
2647
2648 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002649 _exception = 1;
2650 _exceptionType = "java/lang/IllegalArgumentException";
2651 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002652 goto exit;
2653 }
2654 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002655 _exception = 1;
2656 _exceptionType = "java/lang/IllegalArgumentException";
2657 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002658 goto exit;
2659 }
2660 _remaining = _env->GetArrayLength(m_ref) - offset;
2661 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002662 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002663 m = m_base + offset;
2664
2665 glLoadMatrixf(
2666 (GLfloat *)m
2667 );
2668
2669exit:
2670 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002671 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002672 JNI_ABORT);
2673 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002674 if (_exception) {
2675 jniThrowException(_env, _exceptionType, _exceptionMessage);
2676 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002677}
2678
2679/* void glLoadMatrixf ( const GLfloat *m ) */
2680static void
2681android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
2682 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002683 jint _exception = 0;
2684 const char * _exceptionType = NULL;
2685 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002686 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002687 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002688 jint _remaining;
2689 GLfloat *m = (GLfloat *) 0;
2690
Romain Guy84cac202016-12-05 12:26:02 -08002691 if (!m_buf) {
2692 _exception = 1;
2693 _exceptionType = "java/lang/IllegalArgumentException";
2694 _exceptionMessage = "m == null";
2695 goto exit;
2696 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002697 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002698 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002699 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002700 m = (GLfloat *) (_mBase + _bufferOffset);
2701 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002702 glLoadMatrixf(
2703 (GLfloat *)m
2704 );
Romain Guy84cac202016-12-05 12:26:02 -08002705
2706exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002707 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002708 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002709 }
Romain Guy84cac202016-12-05 12:26:02 -08002710 if (_exception) {
2711 jniThrowException(_env, _exceptionType, _exceptionMessage);
2712 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002713}
2714
2715/* void glLoadMatrixx ( const GLfixed *m ) */
2716static void
2717android_glLoadMatrixx___3II
2718 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002719 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002720 const char * _exceptionType = NULL;
2721 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002722 GLfixed *m_base = (GLfixed *) 0;
2723 jint _remaining;
2724 GLfixed *m = (GLfixed *) 0;
2725
2726 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002727 _exception = 1;
2728 _exceptionType = "java/lang/IllegalArgumentException";
2729 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002730 goto exit;
2731 }
2732 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002733 _exception = 1;
2734 _exceptionType = "java/lang/IllegalArgumentException";
2735 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002736 goto exit;
2737 }
2738 _remaining = _env->GetArrayLength(m_ref) - offset;
2739 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002740 _env->GetIntArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002741 m = m_base + offset;
2742
2743 glLoadMatrixx(
2744 (GLfixed *)m
2745 );
2746
2747exit:
2748 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002749 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002750 JNI_ABORT);
2751 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002752 if (_exception) {
2753 jniThrowException(_env, _exceptionType, _exceptionMessage);
2754 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002755}
2756
2757/* void glLoadMatrixx ( const GLfixed *m ) */
2758static void
2759android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2760 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002761 jint _exception = 0;
2762 const char * _exceptionType = NULL;
2763 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002764 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002765 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002766 jint _remaining;
2767 GLfixed *m = (GLfixed *) 0;
2768
Romain Guy84cac202016-12-05 12:26:02 -08002769 if (!m_buf) {
2770 _exception = 1;
2771 _exceptionType = "java/lang/IllegalArgumentException";
2772 _exceptionMessage = "m == null";
2773 goto exit;
2774 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002775 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002776 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002777 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002778 m = (GLfixed *) (_mBase + _bufferOffset);
2779 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002780 glLoadMatrixx(
2781 (GLfixed *)m
2782 );
Romain Guy84cac202016-12-05 12:26:02 -08002783
2784exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002785 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002786 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002787 }
Romain Guy84cac202016-12-05 12:26:02 -08002788 if (_exception) {
2789 jniThrowException(_env, _exceptionType, _exceptionMessage);
2790 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002791}
2792
2793/* void glLogicOp ( GLenum opcode ) */
2794static void
2795android_glLogicOp__I
2796 (JNIEnv *_env, jobject _this, jint opcode) {
2797 glLogicOp(
2798 (GLenum)opcode
2799 );
2800}
2801
2802/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2803static void
2804android_glMaterialf__IIF
2805 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2806 glMaterialf(
2807 (GLenum)face,
2808 (GLenum)pname,
2809 (GLfloat)param
2810 );
2811}
2812
2813/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2814static void
2815android_glMaterialfv__II_3FI
2816 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002817 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002818 const char * _exceptionType = NULL;
2819 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002820 GLfloat *params_base = (GLfloat *) 0;
2821 jint _remaining;
2822 GLfloat *params = (GLfloat *) 0;
2823
2824 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002825 _exception = 1;
2826 _exceptionType = "java/lang/IllegalArgumentException";
2827 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002828 goto exit;
2829 }
2830 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002831 _exception = 1;
2832 _exceptionType = "java/lang/IllegalArgumentException";
2833 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002834 goto exit;
2835 }
2836 _remaining = _env->GetArrayLength(params_ref) - offset;
2837 int _needed;
2838 switch (pname) {
2839#if defined(GL_SHININESS)
2840 case GL_SHININESS:
2841#endif // defined(GL_SHININESS)
2842 _needed = 1;
2843 break;
2844#if defined(GL_AMBIENT)
2845 case GL_AMBIENT:
2846#endif // defined(GL_AMBIENT)
2847#if defined(GL_DIFFUSE)
2848 case GL_DIFFUSE:
2849#endif // defined(GL_DIFFUSE)
2850#if defined(GL_SPECULAR)
2851 case GL_SPECULAR:
2852#endif // defined(GL_SPECULAR)
2853#if defined(GL_EMISSION)
2854 case GL_EMISSION:
2855#endif // defined(GL_EMISSION)
2856#if defined(GL_AMBIENT_AND_DIFFUSE)
2857 case GL_AMBIENT_AND_DIFFUSE:
2858#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2859 _needed = 4;
2860 break;
2861 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002862 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002863 break;
2864 }
2865 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002866 _exception = 1;
2867 _exceptionType = "java/lang/IllegalArgumentException";
2868 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002869 goto exit;
2870 }
2871 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002872 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002873 params = params_base + offset;
2874
2875 glMaterialfv(
2876 (GLenum)face,
2877 (GLenum)pname,
2878 (GLfloat *)params
2879 );
2880
2881exit:
2882 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002883 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002884 JNI_ABORT);
2885 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002886 if (_exception) {
2887 jniThrowException(_env, _exceptionType, _exceptionMessage);
2888 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002889}
2890
2891/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2892static void
2893android_glMaterialfv__IILjava_nio_FloatBuffer_2
2894 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002895 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002896 const char * _exceptionType = NULL;
2897 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002898 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002899 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002900 jint _remaining;
2901 GLfloat *params = (GLfloat *) 0;
2902
Romain Guy84cac202016-12-05 12:26:02 -08002903 if (!params_buf) {
2904 _exception = 1;
2905 _exceptionType = "java/lang/IllegalArgumentException";
2906 _exceptionMessage = "params == null";
2907 goto exit;
2908 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002909 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002910 int _needed;
2911 switch (pname) {
2912#if defined(GL_SHININESS)
2913 case GL_SHININESS:
2914#endif // defined(GL_SHININESS)
2915 _needed = 1;
2916 break;
2917#if defined(GL_AMBIENT)
2918 case GL_AMBIENT:
2919#endif // defined(GL_AMBIENT)
2920#if defined(GL_DIFFUSE)
2921 case GL_DIFFUSE:
2922#endif // defined(GL_DIFFUSE)
2923#if defined(GL_SPECULAR)
2924 case GL_SPECULAR:
2925#endif // defined(GL_SPECULAR)
2926#if defined(GL_EMISSION)
2927 case GL_EMISSION:
2928#endif // defined(GL_EMISSION)
2929#if defined(GL_AMBIENT_AND_DIFFUSE)
2930 case GL_AMBIENT_AND_DIFFUSE:
2931#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2932 _needed = 4;
2933 break;
2934 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002935 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002936 break;
2937 }
2938 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002939 _exception = 1;
2940 _exceptionType = "java/lang/IllegalArgumentException";
2941 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002942 goto exit;
2943 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002944 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002945 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002946 params = (GLfloat *) (_paramsBase + _bufferOffset);
2947 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002948 glMaterialfv(
2949 (GLenum)face,
2950 (GLenum)pname,
2951 (GLfloat *)params
2952 );
2953
2954exit:
2955 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002956 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002957 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002958 if (_exception) {
2959 jniThrowException(_env, _exceptionType, _exceptionMessage);
2960 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002961}
2962
2963/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
2964static void
2965android_glMaterialx__III
2966 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
2967 glMaterialx(
2968 (GLenum)face,
2969 (GLenum)pname,
2970 (GLfixed)param
2971 );
2972}
2973
2974/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2975static void
2976android_glMaterialxv__II_3II
2977 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002978 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002979 const char * _exceptionType = NULL;
2980 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002981 GLfixed *params_base = (GLfixed *) 0;
2982 jint _remaining;
2983 GLfixed *params = (GLfixed *) 0;
2984
2985 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002986 _exception = 1;
2987 _exceptionType = "java/lang/IllegalArgumentException";
2988 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002989 goto exit;
2990 }
2991 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002992 _exception = 1;
2993 _exceptionType = "java/lang/IllegalArgumentException";
2994 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002995 goto exit;
2996 }
2997 _remaining = _env->GetArrayLength(params_ref) - offset;
2998 int _needed;
2999 switch (pname) {
3000#if defined(GL_SHININESS)
3001 case GL_SHININESS:
3002#endif // defined(GL_SHININESS)
3003 _needed = 1;
3004 break;
3005#if defined(GL_AMBIENT)
3006 case GL_AMBIENT:
3007#endif // defined(GL_AMBIENT)
3008#if defined(GL_DIFFUSE)
3009 case GL_DIFFUSE:
3010#endif // defined(GL_DIFFUSE)
3011#if defined(GL_SPECULAR)
3012 case GL_SPECULAR:
3013#endif // defined(GL_SPECULAR)
3014#if defined(GL_EMISSION)
3015 case GL_EMISSION:
3016#endif // defined(GL_EMISSION)
3017#if defined(GL_AMBIENT_AND_DIFFUSE)
3018 case GL_AMBIENT_AND_DIFFUSE:
3019#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3020 _needed = 4;
3021 break;
3022 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003023 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003024 break;
3025 }
3026 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003027 _exception = 1;
3028 _exceptionType = "java/lang/IllegalArgumentException";
3029 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003030 goto exit;
3031 }
3032 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003033 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003034 params = params_base + offset;
3035
3036 glMaterialxv(
3037 (GLenum)face,
3038 (GLenum)pname,
3039 (GLfixed *)params
3040 );
3041
3042exit:
3043 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003044 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003045 JNI_ABORT);
3046 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003047 if (_exception) {
3048 jniThrowException(_env, _exceptionType, _exceptionMessage);
3049 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003050}
3051
3052/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
3053static void
3054android_glMaterialxv__IILjava_nio_IntBuffer_2
3055 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003056 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003057 const char * _exceptionType = NULL;
3058 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003059 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003060 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003061 jint _remaining;
3062 GLfixed *params = (GLfixed *) 0;
3063
Romain Guy84cac202016-12-05 12:26:02 -08003064 if (!params_buf) {
3065 _exception = 1;
3066 _exceptionType = "java/lang/IllegalArgumentException";
3067 _exceptionMessage = "params == null";
3068 goto exit;
3069 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003070 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003071 int _needed;
3072 switch (pname) {
3073#if defined(GL_SHININESS)
3074 case GL_SHININESS:
3075#endif // defined(GL_SHININESS)
3076 _needed = 1;
3077 break;
3078#if defined(GL_AMBIENT)
3079 case GL_AMBIENT:
3080#endif // defined(GL_AMBIENT)
3081#if defined(GL_DIFFUSE)
3082 case GL_DIFFUSE:
3083#endif // defined(GL_DIFFUSE)
3084#if defined(GL_SPECULAR)
3085 case GL_SPECULAR:
3086#endif // defined(GL_SPECULAR)
3087#if defined(GL_EMISSION)
3088 case GL_EMISSION:
3089#endif // defined(GL_EMISSION)
3090#if defined(GL_AMBIENT_AND_DIFFUSE)
3091 case GL_AMBIENT_AND_DIFFUSE:
3092#endif // defined(GL_AMBIENT_AND_DIFFUSE)
3093 _needed = 4;
3094 break;
3095 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003096 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003097 break;
3098 }
3099 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003100 _exception = 1;
3101 _exceptionType = "java/lang/IllegalArgumentException";
3102 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003103 goto exit;
3104 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003105 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003106 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003107 params = (GLfixed *) (_paramsBase + _bufferOffset);
3108 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003109 glMaterialxv(
3110 (GLenum)face,
3111 (GLenum)pname,
3112 (GLfixed *)params
3113 );
3114
3115exit:
3116 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003117 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003118 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003119 if (_exception) {
3120 jniThrowException(_env, _exceptionType, _exceptionMessage);
3121 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003122}
3123
3124/* void glMatrixMode ( GLenum mode ) */
3125static void
3126android_glMatrixMode__I
3127 (JNIEnv *_env, jobject _this, jint mode) {
3128 glMatrixMode(
3129 (GLenum)mode
3130 );
3131}
3132
3133/* void glMultMatrixf ( const GLfloat *m ) */
3134static void
3135android_glMultMatrixf___3FI
3136 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003137 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003138 const char * _exceptionType = NULL;
3139 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003140 GLfloat *m_base = (GLfloat *) 0;
3141 jint _remaining;
3142 GLfloat *m = (GLfloat *) 0;
3143
3144 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003145 _exception = 1;
3146 _exceptionType = "java/lang/IllegalArgumentException";
3147 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003148 goto exit;
3149 }
3150 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003151 _exception = 1;
3152 _exceptionType = "java/lang/IllegalArgumentException";
3153 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003154 goto exit;
3155 }
3156 _remaining = _env->GetArrayLength(m_ref) - offset;
3157 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003158 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003159 m = m_base + offset;
3160
3161 glMultMatrixf(
3162 (GLfloat *)m
3163 );
3164
3165exit:
3166 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003167 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003168 JNI_ABORT);
3169 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003170 if (_exception) {
3171 jniThrowException(_env, _exceptionType, _exceptionMessage);
3172 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003173}
3174
3175/* void glMultMatrixf ( const GLfloat *m ) */
3176static void
3177android_glMultMatrixf__Ljava_nio_FloatBuffer_2
3178 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003179 jint _exception = 0;
3180 const char * _exceptionType = NULL;
3181 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003182 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003183 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003184 jint _remaining;
3185 GLfloat *m = (GLfloat *) 0;
3186
Romain Guy84cac202016-12-05 12:26:02 -08003187 if (!m_buf) {
3188 _exception = 1;
3189 _exceptionType = "java/lang/IllegalArgumentException";
3190 _exceptionMessage = "m == null";
3191 goto exit;
3192 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003193 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003194 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003195 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003196 m = (GLfloat *) (_mBase + _bufferOffset);
3197 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003198 glMultMatrixf(
3199 (GLfloat *)m
3200 );
Romain Guy84cac202016-12-05 12:26:02 -08003201
3202exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003203 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003204 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003205 }
Romain Guy84cac202016-12-05 12:26:02 -08003206 if (_exception) {
3207 jniThrowException(_env, _exceptionType, _exceptionMessage);
3208 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003209}
3210
3211/* void glMultMatrixx ( const GLfixed *m ) */
3212static void
3213android_glMultMatrixx___3II
3214 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003215 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003216 const char * _exceptionType = NULL;
3217 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003218 GLfixed *m_base = (GLfixed *) 0;
3219 jint _remaining;
3220 GLfixed *m = (GLfixed *) 0;
3221
3222 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003223 _exception = 1;
3224 _exceptionType = "java/lang/IllegalArgumentException";
3225 _exceptionMessage = "m == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003226 goto exit;
3227 }
3228 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003229 _exception = 1;
3230 _exceptionType = "java/lang/IllegalArgumentException";
3231 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003232 goto exit;
3233 }
3234 _remaining = _env->GetArrayLength(m_ref) - offset;
3235 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003236 _env->GetIntArrayElements(m_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003237 m = m_base + offset;
3238
3239 glMultMatrixx(
3240 (GLfixed *)m
3241 );
3242
3243exit:
3244 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003245 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003246 JNI_ABORT);
3247 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003248 if (_exception) {
3249 jniThrowException(_env, _exceptionType, _exceptionMessage);
3250 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003251}
3252
3253/* void glMultMatrixx ( const GLfixed *m ) */
3254static void
3255android_glMultMatrixx__Ljava_nio_IntBuffer_2
3256 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003257 jint _exception = 0;
3258 const char * _exceptionType = NULL;
3259 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003260 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003261 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003262 jint _remaining;
3263 GLfixed *m = (GLfixed *) 0;
3264
Romain Guy84cac202016-12-05 12:26:02 -08003265 if (!m_buf) {
3266 _exception = 1;
3267 _exceptionType = "java/lang/IllegalArgumentException";
3268 _exceptionMessage = "m == null";
3269 goto exit;
3270 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003271 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003272 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003273 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003274 m = (GLfixed *) (_mBase + _bufferOffset);
3275 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003276 glMultMatrixx(
3277 (GLfixed *)m
3278 );
Romain Guy84cac202016-12-05 12:26:02 -08003279
3280exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003281 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003282 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003283 }
Romain Guy84cac202016-12-05 12:26:02 -08003284 if (_exception) {
3285 jniThrowException(_env, _exceptionType, _exceptionMessage);
3286 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003287}
3288
3289/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
3290static void
3291android_glMultiTexCoord4f__IFFFF
3292 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
3293 glMultiTexCoord4f(
3294 (GLenum)target,
3295 (GLfloat)s,
3296 (GLfloat)t,
3297 (GLfloat)r,
3298 (GLfloat)q
3299 );
3300}
3301
3302/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
3303static void
3304android_glMultiTexCoord4x__IIIII
3305 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
3306 glMultiTexCoord4x(
3307 (GLenum)target,
3308 (GLfixed)s,
3309 (GLfixed)t,
3310 (GLfixed)r,
3311 (GLfixed)q
3312 );
3313}
3314
3315/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
3316static void
3317android_glNormal3f__FFF
3318 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
3319 glNormal3f(
3320 (GLfloat)nx,
3321 (GLfloat)ny,
3322 (GLfloat)nz
3323 );
3324}
3325
3326/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
3327static void
3328android_glNormal3x__III
3329 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
3330 glNormal3x(
3331 (GLfixed)nx,
3332 (GLfixed)ny,
3333 (GLfixed)nz
3334 );
3335}
3336
3337/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
3338static void
3339android_glNormalPointerBounds__IILjava_nio_Buffer_2I
3340 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08003341 jint _exception = 0;
3342 const char * _exceptionType = NULL;
3343 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003344 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003345 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003346 jint _remaining;
3347 GLvoid *pointer = (GLvoid *) 0;
3348
Jack Paleviche20ea782009-05-07 18:28:29 -07003349 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003350 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003351 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003352 return;
3353 }
3354 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003355 glNormalPointerBounds(
3356 (GLenum)type,
3357 (GLsizei)stride,
3358 (GLvoid *)pointer,
3359 (GLsizei)remaining
3360 );
Romain Guy84cac202016-12-05 12:26:02 -08003361 if (_exception) {
3362 jniThrowException(_env, _exceptionType, _exceptionMessage);
3363 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003364}
3365
3366/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
3367static void
3368android_glOrthof__FFFFFF
3369 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
3370 glOrthof(
3371 (GLfloat)left,
3372 (GLfloat)right,
3373 (GLfloat)bottom,
3374 (GLfloat)top,
3375 (GLfloat)zNear,
3376 (GLfloat)zFar
3377 );
3378}
3379
3380/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
3381static void
3382android_glOrthox__IIIIII
3383 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
3384 glOrthox(
3385 (GLfixed)left,
3386 (GLfixed)right,
3387 (GLfixed)bottom,
3388 (GLfixed)top,
3389 (GLfixed)zNear,
3390 (GLfixed)zFar
3391 );
3392}
3393
3394/* void glPixelStorei ( GLenum pname, GLint param ) */
3395static void
3396android_glPixelStorei__II
3397 (JNIEnv *_env, jobject _this, jint pname, jint param) {
3398 glPixelStorei(
3399 (GLenum)pname,
3400 (GLint)param
3401 );
3402}
3403
3404/* void glPointSize ( GLfloat size ) */
3405static void
3406android_glPointSize__F
3407 (JNIEnv *_env, jobject _this, jfloat size) {
3408 glPointSize(
3409 (GLfloat)size
3410 );
3411}
3412
3413/* void glPointSizex ( GLfixed size ) */
3414static void
3415android_glPointSizex__I
3416 (JNIEnv *_env, jobject _this, jint size) {
3417 glPointSizex(
3418 (GLfixed)size
3419 );
3420}
3421
3422/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
3423static void
3424android_glPolygonOffset__FF
3425 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
3426 glPolygonOffset(
3427 (GLfloat)factor,
3428 (GLfloat)units
3429 );
3430}
3431
3432/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
3433static void
3434android_glPolygonOffsetx__II
3435 (JNIEnv *_env, jobject _this, jint factor, jint units) {
3436 glPolygonOffsetx(
3437 (GLfixed)factor,
3438 (GLfixed)units
3439 );
3440}
3441
3442/* void glPopMatrix ( void ) */
3443static void
3444android_glPopMatrix__
3445 (JNIEnv *_env, jobject _this) {
3446 glPopMatrix();
3447}
3448
3449/* void glPushMatrix ( void ) */
3450static void
3451android_glPushMatrix__
3452 (JNIEnv *_env, jobject _this) {
3453 glPushMatrix();
3454}
3455
3456/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
3457static void
3458android_glReadPixels__IIIIIILjava_nio_Buffer_2
3459 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003460 jint _exception = 0;
3461 const char * _exceptionType = NULL;
3462 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003463 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003464 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003465 jint _remaining;
3466 GLvoid *pixels = (GLvoid *) 0;
3467
Romain Guy84cac202016-12-05 12:26:02 -08003468 if (!pixels_buf) {
3469 _exception = 1;
3470 _exceptionType = "java/lang/IllegalArgumentException";
3471 _exceptionMessage = "pixels == null";
3472 goto exit;
3473 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003474 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003475 if (pixels == NULL) {
3476 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3477 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3478 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003479 glReadPixels(
3480 (GLint)x,
3481 (GLint)y,
3482 (GLsizei)width,
3483 (GLsizei)height,
3484 (GLenum)format,
3485 (GLenum)type,
3486 (GLvoid *)pixels
3487 );
Romain Guy84cac202016-12-05 12:26:02 -08003488
3489exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003490 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08003491 releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE);
3492 }
3493 if (_exception) {
3494 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003495 }
3496}
3497
3498/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
3499static void
3500android_glRotatef__FFFF
3501 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
3502 glRotatef(
3503 (GLfloat)angle,
3504 (GLfloat)x,
3505 (GLfloat)y,
3506 (GLfloat)z
3507 );
3508}
3509
3510/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
3511static void
3512android_glRotatex__IIII
3513 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
3514 glRotatex(
3515 (GLfixed)angle,
3516 (GLfixed)x,
3517 (GLfixed)y,
3518 (GLfixed)z
3519 );
3520}
3521
3522/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
3523static void
3524android_glSampleCoverage__FZ
3525 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
3526 glSampleCoverage(
3527 (GLclampf)value,
3528 (GLboolean)invert
3529 );
3530}
3531
3532/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
3533static void
3534android_glSampleCoveragex__IZ
3535 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
3536 glSampleCoveragex(
3537 (GLclampx)value,
3538 (GLboolean)invert
3539 );
3540}
3541
3542/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
3543static void
3544android_glScalef__FFF
3545 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3546 glScalef(
3547 (GLfloat)x,
3548 (GLfloat)y,
3549 (GLfloat)z
3550 );
3551}
3552
3553/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
3554static void
3555android_glScalex__III
3556 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3557 glScalex(
3558 (GLfixed)x,
3559 (GLfixed)y,
3560 (GLfixed)z
3561 );
3562}
3563
3564/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3565static void
3566android_glScissor__IIII
3567 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3568 glScissor(
3569 (GLint)x,
3570 (GLint)y,
3571 (GLsizei)width,
3572 (GLsizei)height
3573 );
3574}
3575
3576/* void glShadeModel ( GLenum mode ) */
3577static void
3578android_glShadeModel__I
3579 (JNIEnv *_env, jobject _this, jint mode) {
3580 glShadeModel(
3581 (GLenum)mode
3582 );
3583}
3584
3585/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
3586static void
3587android_glStencilFunc__III
3588 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
3589 glStencilFunc(
3590 (GLenum)func,
3591 (GLint)ref,
3592 (GLuint)mask
3593 );
3594}
3595
3596/* void glStencilMask ( GLuint mask ) */
3597static void
3598android_glStencilMask__I
3599 (JNIEnv *_env, jobject _this, jint mask) {
3600 glStencilMask(
3601 (GLuint)mask
3602 );
3603}
3604
3605/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
3606static void
3607android_glStencilOp__III
3608 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
3609 glStencilOp(
3610 (GLenum)fail,
3611 (GLenum)zfail,
3612 (GLenum)zpass
3613 );
3614}
3615
3616/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3617static void
3618android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
3619 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08003620 jint _exception = 0;
3621 const char * _exceptionType = NULL;
3622 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003623 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003624 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003625 jint _remaining;
3626 GLvoid *pointer = (GLvoid *) 0;
3627
Jack Paleviche20ea782009-05-07 18:28:29 -07003628 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003629 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003630 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003631 return;
3632 }
3633 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003634 glTexCoordPointerBounds(
3635 (GLint)size,
3636 (GLenum)type,
3637 (GLsizei)stride,
3638 (GLvoid *)pointer,
3639 (GLsizei)remaining
3640 );
Romain Guy84cac202016-12-05 12:26:02 -08003641 if (_exception) {
3642 jniThrowException(_env, _exceptionType, _exceptionMessage);
3643 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003644}
3645
3646/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
3647static void
3648android_glTexEnvf__IIF
3649 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3650 glTexEnvf(
3651 (GLenum)target,
3652 (GLenum)pname,
3653 (GLfloat)param
3654 );
3655}
3656
3657/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3658static void
3659android_glTexEnvfv__II_3FI
3660 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003661 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003662 const char * _exceptionType = NULL;
3663 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003664 GLfloat *params_base = (GLfloat *) 0;
3665 jint _remaining;
3666 GLfloat *params = (GLfloat *) 0;
3667
3668 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003669 _exception = 1;
3670 _exceptionType = "java/lang/IllegalArgumentException";
3671 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003672 goto exit;
3673 }
3674 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003675 _exception = 1;
3676 _exceptionType = "java/lang/IllegalArgumentException";
3677 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003678 goto exit;
3679 }
3680 _remaining = _env->GetArrayLength(params_ref) - offset;
3681 int _needed;
3682 switch (pname) {
3683#if defined(GL_TEXTURE_ENV_MODE)
3684 case GL_TEXTURE_ENV_MODE:
3685#endif // defined(GL_TEXTURE_ENV_MODE)
3686#if defined(GL_COMBINE_RGB)
3687 case GL_COMBINE_RGB:
3688#endif // defined(GL_COMBINE_RGB)
3689#if defined(GL_COMBINE_ALPHA)
3690 case GL_COMBINE_ALPHA:
3691#endif // defined(GL_COMBINE_ALPHA)
3692 _needed = 1;
3693 break;
3694#if defined(GL_TEXTURE_ENV_COLOR)
3695 case GL_TEXTURE_ENV_COLOR:
3696#endif // defined(GL_TEXTURE_ENV_COLOR)
3697 _needed = 4;
3698 break;
3699 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003700 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003701 break;
3702 }
3703 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003704 _exception = 1;
3705 _exceptionType = "java/lang/IllegalArgumentException";
3706 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003707 goto exit;
3708 }
3709 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003710 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003711 params = params_base + offset;
3712
3713 glTexEnvfv(
3714 (GLenum)target,
3715 (GLenum)pname,
3716 (GLfloat *)params
3717 );
3718
3719exit:
3720 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003721 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003722 JNI_ABORT);
3723 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003724 if (_exception) {
3725 jniThrowException(_env, _exceptionType, _exceptionMessage);
3726 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003727}
3728
3729/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3730static void
3731android_glTexEnvfv__IILjava_nio_FloatBuffer_2
3732 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003733 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003734 const char * _exceptionType = NULL;
3735 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003736 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003737 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003738 jint _remaining;
3739 GLfloat *params = (GLfloat *) 0;
3740
Romain Guy84cac202016-12-05 12:26:02 -08003741 if (!params_buf) {
3742 _exception = 1;
3743 _exceptionType = "java/lang/IllegalArgumentException";
3744 _exceptionMessage = "params == null";
3745 goto exit;
3746 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003747 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003748 int _needed;
3749 switch (pname) {
3750#if defined(GL_TEXTURE_ENV_MODE)
3751 case GL_TEXTURE_ENV_MODE:
3752#endif // defined(GL_TEXTURE_ENV_MODE)
3753#if defined(GL_COMBINE_RGB)
3754 case GL_COMBINE_RGB:
3755#endif // defined(GL_COMBINE_RGB)
3756#if defined(GL_COMBINE_ALPHA)
3757 case GL_COMBINE_ALPHA:
3758#endif // defined(GL_COMBINE_ALPHA)
3759 _needed = 1;
3760 break;
3761#if defined(GL_TEXTURE_ENV_COLOR)
3762 case GL_TEXTURE_ENV_COLOR:
3763#endif // defined(GL_TEXTURE_ENV_COLOR)
3764 _needed = 4;
3765 break;
3766 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003767 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003768 break;
3769 }
3770 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003771 _exception = 1;
3772 _exceptionType = "java/lang/IllegalArgumentException";
3773 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003774 goto exit;
3775 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003776 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003777 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003778 params = (GLfloat *) (_paramsBase + _bufferOffset);
3779 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003780 glTexEnvfv(
3781 (GLenum)target,
3782 (GLenum)pname,
3783 (GLfloat *)params
3784 );
3785
3786exit:
3787 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003788 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003789 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003790 if (_exception) {
3791 jniThrowException(_env, _exceptionType, _exceptionMessage);
3792 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003793}
3794
3795/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
3796static void
3797android_glTexEnvx__III
3798 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3799 glTexEnvx(
3800 (GLenum)target,
3801 (GLenum)pname,
3802 (GLfixed)param
3803 );
3804}
3805
3806/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3807static void
3808android_glTexEnvxv__II_3II
3809 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003810 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003811 const char * _exceptionType = NULL;
3812 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003813 GLfixed *params_base = (GLfixed *) 0;
3814 jint _remaining;
3815 GLfixed *params = (GLfixed *) 0;
3816
3817 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003818 _exception = 1;
3819 _exceptionType = "java/lang/IllegalArgumentException";
3820 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003821 goto exit;
3822 }
3823 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003824 _exception = 1;
3825 _exceptionType = "java/lang/IllegalArgumentException";
3826 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003827 goto exit;
3828 }
3829 _remaining = _env->GetArrayLength(params_ref) - offset;
3830 int _needed;
3831 switch (pname) {
3832#if defined(GL_TEXTURE_ENV_MODE)
3833 case GL_TEXTURE_ENV_MODE:
3834#endif // defined(GL_TEXTURE_ENV_MODE)
3835#if defined(GL_COMBINE_RGB)
3836 case GL_COMBINE_RGB:
3837#endif // defined(GL_COMBINE_RGB)
3838#if defined(GL_COMBINE_ALPHA)
3839 case GL_COMBINE_ALPHA:
3840#endif // defined(GL_COMBINE_ALPHA)
3841 _needed = 1;
3842 break;
3843#if defined(GL_TEXTURE_ENV_COLOR)
3844 case GL_TEXTURE_ENV_COLOR:
3845#endif // defined(GL_TEXTURE_ENV_COLOR)
3846 _needed = 4;
3847 break;
3848 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003849 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003850 break;
3851 }
3852 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003853 _exception = 1;
3854 _exceptionType = "java/lang/IllegalArgumentException";
3855 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003856 goto exit;
3857 }
3858 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003859 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003860 params = params_base + offset;
3861
3862 glTexEnvxv(
3863 (GLenum)target,
3864 (GLenum)pname,
3865 (GLfixed *)params
3866 );
3867
3868exit:
3869 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003870 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003871 JNI_ABORT);
3872 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003873 if (_exception) {
3874 jniThrowException(_env, _exceptionType, _exceptionMessage);
3875 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003876}
3877
3878/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3879static void
3880android_glTexEnvxv__IILjava_nio_IntBuffer_2
3881 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003882 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08003883 const char * _exceptionType = NULL;
3884 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003885 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003886 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003887 jint _remaining;
3888 GLfixed *params = (GLfixed *) 0;
3889
Romain Guy84cac202016-12-05 12:26:02 -08003890 if (!params_buf) {
3891 _exception = 1;
3892 _exceptionType = "java/lang/IllegalArgumentException";
3893 _exceptionMessage = "params == null";
3894 goto exit;
3895 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003896 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003897 int _needed;
3898 switch (pname) {
3899#if defined(GL_TEXTURE_ENV_MODE)
3900 case GL_TEXTURE_ENV_MODE:
3901#endif // defined(GL_TEXTURE_ENV_MODE)
3902#if defined(GL_COMBINE_RGB)
3903 case GL_COMBINE_RGB:
3904#endif // defined(GL_COMBINE_RGB)
3905#if defined(GL_COMBINE_ALPHA)
3906 case GL_COMBINE_ALPHA:
3907#endif // defined(GL_COMBINE_ALPHA)
3908 _needed = 1;
3909 break;
3910#if defined(GL_TEXTURE_ENV_COLOR)
3911 case GL_TEXTURE_ENV_COLOR:
3912#endif // defined(GL_TEXTURE_ENV_COLOR)
3913 _needed = 4;
3914 break;
3915 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08003916 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003917 break;
3918 }
3919 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003920 _exception = 1;
3921 _exceptionType = "java/lang/IllegalArgumentException";
3922 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003923 goto exit;
3924 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003925 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003926 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003927 params = (GLfixed *) (_paramsBase + _bufferOffset);
3928 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003929 glTexEnvxv(
3930 (GLenum)target,
3931 (GLenum)pname,
3932 (GLfixed *)params
3933 );
3934
3935exit:
3936 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003937 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003938 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003939 if (_exception) {
3940 jniThrowException(_env, _exceptionType, _exceptionMessage);
3941 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003942}
3943
3944/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
3945static void
3946android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
3947 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003948 jint _exception = 0;
3949 const char * _exceptionType = NULL;
3950 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003951 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003952 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003953 jint _remaining;
3954 GLvoid *pixels = (GLvoid *) 0;
3955
3956 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003957 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003958 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07003959 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003960 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3961 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003962 }
3963 glTexImage2D(
3964 (GLenum)target,
3965 (GLint)level,
3966 (GLint)internalformat,
3967 (GLsizei)width,
3968 (GLsizei)height,
3969 (GLint)border,
3970 (GLenum)format,
3971 (GLenum)type,
3972 (GLvoid *)pixels
3973 );
3974 if (_array) {
3975 releasePointer(_env, _array, pixels, JNI_FALSE);
3976 }
Romain Guy84cac202016-12-05 12:26:02 -08003977 if (_exception) {
3978 jniThrowException(_env, _exceptionType, _exceptionMessage);
3979 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003980}
3981
3982/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
3983static void
3984android_glTexParameterf__IIF
3985 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3986 glTexParameterf(
3987 (GLenum)target,
3988 (GLenum)pname,
3989 (GLfloat)param
3990 );
3991}
3992
3993/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
3994static void
3995android_glTexParameterx__III
3996 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3997 glTexParameterx(
3998 (GLenum)target,
3999 (GLenum)pname,
4000 (GLfixed)param
4001 );
4002}
4003
4004/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
4005static void
4006android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
4007 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004008 jint _exception = 0;
4009 const char * _exceptionType = NULL;
4010 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004011 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004012 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004013 jint _remaining;
4014 GLvoid *pixels = (GLvoid *) 0;
4015
4016 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004017 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004018 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004019 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004020 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4021 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004022 }
4023 glTexSubImage2D(
4024 (GLenum)target,
4025 (GLint)level,
4026 (GLint)xoffset,
4027 (GLint)yoffset,
4028 (GLsizei)width,
4029 (GLsizei)height,
4030 (GLenum)format,
4031 (GLenum)type,
4032 (GLvoid *)pixels
4033 );
4034 if (_array) {
4035 releasePointer(_env, _array, pixels, JNI_FALSE);
4036 }
Romain Guy84cac202016-12-05 12:26:02 -08004037 if (_exception) {
4038 jniThrowException(_env, _exceptionType, _exceptionMessage);
4039 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004040}
4041
4042/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
4043static void
4044android_glTranslatef__FFF
4045 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
4046 glTranslatef(
4047 (GLfloat)x,
4048 (GLfloat)y,
4049 (GLfloat)z
4050 );
4051}
4052
4053/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
4054static void
4055android_glTranslatex__III
4056 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
4057 glTranslatex(
4058 (GLfixed)x,
4059 (GLfixed)y,
4060 (GLfixed)z
4061 );
4062}
4063
4064/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
4065static void
4066android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
4067 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08004068 jint _exception = 0;
4069 const char * _exceptionType = NULL;
4070 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004071 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004072 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004073 jint _remaining;
4074 GLvoid *pointer = (GLvoid *) 0;
4075
Jack Paleviche20ea782009-05-07 18:28:29 -07004076 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07004077 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07004078 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07004079 return;
4080 }
4081 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004082 glVertexPointerBounds(
4083 (GLint)size,
4084 (GLenum)type,
4085 (GLsizei)stride,
4086 (GLvoid *)pointer,
4087 (GLsizei)remaining
4088 );
Romain Guy84cac202016-12-05 12:26:02 -08004089 if (_exception) {
4090 jniThrowException(_env, _exceptionType, _exceptionMessage);
4091 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004092}
4093
4094/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
4095static void
4096android_glViewport__IIII
4097 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
4098 glViewport(
4099 (GLint)x,
4100 (GLint)y,
4101 (GLsizei)width,
4102 (GLsizei)height
4103 );
4104}
4105
4106/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4107static jint
4108android_glQueryMatrixxOES___3II_3II
4109 (JNIEnv *_env, jobject _this, jintArray mantissa_ref, jint mantissaOffset, jintArray exponent_ref, jint exponentOffset) {
4110 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004111 const char * _exceptionType = NULL;
4112 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004113 GLbitfield _returnValue = -1;
4114 GLfixed *mantissa_base = (GLfixed *) 0;
4115 jint _mantissaRemaining;
4116 GLfixed *mantissa = (GLfixed *) 0;
4117 GLint *exponent_base = (GLint *) 0;
4118 jint _exponentRemaining;
4119 GLint *exponent = (GLint *) 0;
4120
4121 if (!mantissa_ref) {
4122 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004123 _exceptionType = "java/lang/IllegalArgumentException";
4124 _exceptionMessage = "mantissa == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004125 goto exit;
4126 }
4127 if (mantissaOffset < 0) {
4128 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004129 _exceptionType = "java/lang/IllegalArgumentException";
4130 _exceptionMessage = "mantissaOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004131 goto exit;
4132 }
4133 _mantissaRemaining = _env->GetArrayLength(mantissa_ref) - mantissaOffset;
4134 if (_mantissaRemaining < 16) {
4135 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004136 _exceptionType = "java/lang/IllegalArgumentException";
4137 _exceptionMessage = "length - mantissaOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004138 goto exit;
4139 }
4140 mantissa_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004141 _env->GetIntArrayElements(mantissa_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004142 mantissa = mantissa_base + mantissaOffset;
4143
4144 if (!exponent_ref) {
4145 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004146 _exceptionType = "java/lang/IllegalArgumentException";
4147 _exceptionMessage = "exponent == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004148 goto exit;
4149 }
4150 if (exponentOffset < 0) {
4151 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004152 _exceptionType = "java/lang/IllegalArgumentException";
4153 _exceptionMessage = "exponentOffset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004154 goto exit;
4155 }
4156 _exponentRemaining = _env->GetArrayLength(exponent_ref) - exponentOffset;
4157 if (_exponentRemaining < 16) {
4158 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004159 _exceptionType = "java/lang/IllegalArgumentException";
4160 _exceptionMessage = "length - exponentOffset < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004161 goto exit;
4162 }
4163 exponent_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004164 _env->GetIntArrayElements(exponent_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004165 exponent = exponent_base + exponentOffset;
4166
4167 _returnValue = glQueryMatrixxOES(
4168 (GLfixed *)mantissa,
4169 (GLint *)exponent
4170 );
4171
4172exit:
4173 if (exponent_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004174 _env->ReleaseIntArrayElements(exponent_ref, (jint*)exponent_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004175 _exception ? JNI_ABORT: 0);
4176 }
4177 if (mantissa_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004178 _env->ReleaseIntArrayElements(mantissa_ref, (jint*)mantissa_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004179 _exception ? JNI_ABORT: 0);
4180 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004181 if (_exception) {
4182 jniThrowException(_env, _exceptionType, _exceptionMessage);
Orion Hodsonc240f222019-02-26 18:05:03 +00004183 return (jint)0;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004184 }
Elliott Hughes428d3fc2013-09-24 17:15:41 -07004185 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004186}
4187
4188/* GLbitfield glQueryMatrixxOES ( GLfixed *mantissa, GLint *exponent ) */
4189static jint
4190android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
4191 (JNIEnv *_env, jobject _this, jobject mantissa_buf, jobject exponent_buf) {
4192 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004193 const char * _exceptionType = NULL;
4194 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004195 jintArray _mantissaArray = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004196 jint _mantissaBufferOffset = (jint) 0;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004197 jintArray _exponentArray = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004198 jint _exponentBufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004199 GLbitfield _returnValue = -1;
4200 jint _mantissaRemaining;
4201 GLfixed *mantissa = (GLfixed *) 0;
4202 jint _exponentRemaining;
4203 GLint *exponent = (GLint *) 0;
4204
Romain Guy84cac202016-12-05 12:26:02 -08004205 if (!mantissa_buf) {
4206 _exception = 1;
4207 _exceptionType = "java/lang/IllegalArgumentException";
4208 _exceptionMessage = "mantissa == null";
4209 goto exit;
4210 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004211 mantissa = (GLfixed *)getPointer(_env, mantissa_buf, (jarray*)&_mantissaArray, &_mantissaRemaining, &_mantissaBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004212 if (_mantissaRemaining < 16) {
4213 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004214 _exceptionType = "java/lang/IllegalArgumentException";
4215 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004216 goto exit;
4217 }
Romain Guy84cac202016-12-05 12:26:02 -08004218 if (!exponent_buf) {
4219 _exception = 1;
4220 _exceptionType = "java/lang/IllegalArgumentException";
4221 _exceptionMessage = "exponent == null";
4222 goto exit;
4223 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004224 exponent = (GLint *)getPointer(_env, exponent_buf, (jarray*)&_exponentArray, &_exponentRemaining, &_exponentBufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004225 if (_exponentRemaining < 16) {
4226 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004227 _exceptionType = "java/lang/IllegalArgumentException";
4228 _exceptionMessage = "remaining() < 16 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004229 goto exit;
4230 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004231 if (mantissa == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004232 char * _mantissaBase = (char *)_env->GetIntArrayElements(_mantissaArray, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004233 mantissa = (GLfixed *) (_mantissaBase + _mantissaBufferOffset);
4234 }
4235 if (exponent == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004236 char * _exponentBase = (char *)_env->GetIntArrayElements(_exponentArray, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004237 exponent = (GLint *) (_exponentBase + _exponentBufferOffset);
4238 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004239 _returnValue = glQueryMatrixxOES(
4240 (GLfixed *)mantissa,
4241 (GLint *)exponent
4242 );
4243
4244exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004245 if (_exponentArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004246 _env->ReleaseIntArrayElements(_exponentArray, (jint*)exponent, _exception ? JNI_ABORT : 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004247 }
4248 if (_mantissaArray) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004249 _env->ReleaseIntArrayElements(_mantissaArray, (jint*)mantissa, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004250 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004251 if (_exception) {
4252 jniThrowException(_env, _exceptionType, _exceptionMessage);
Orion Hodsonc240f222019-02-26 18:05:03 +00004253 return (jint)0;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004254 }
Elliott Hughes428d3fc2013-09-24 17:15:41 -07004255 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004256}
4257
4258/* void glBindBuffer ( GLenum target, GLuint buffer ) */
4259static void
4260android_glBindBuffer__II
4261 (JNIEnv *_env, jobject _this, jint target, jint buffer) {
4262 glBindBuffer(
4263 (GLenum)target,
4264 (GLuint)buffer
4265 );
4266}
4267
4268/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */
4269static void
4270android_glBufferData__IILjava_nio_Buffer_2I
4271 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004272 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004273 const char * _exceptionType = NULL;
4274 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004275 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004276 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004277 jint _remaining;
4278 GLvoid *data = (GLvoid *) 0;
4279
4280 if (data_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004281 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004282 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004283 _exception = 1;
4284 _exceptionType = "java/lang/IllegalArgumentException";
4285 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004286 goto exit;
4287 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004288 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07004289 if (data_buf && data == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004290 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4291 data = (GLvoid *) (_dataBase + _bufferOffset);
4292 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004293 glBufferData(
4294 (GLenum)target,
4295 (GLsizeiptr)size,
4296 (GLvoid *)data,
4297 (GLenum)usage
4298 );
Jack Palevichc620a522009-10-21 11:02:44 -07004299
4300exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004301 if (_array) {
4302 releasePointer(_env, _array, data, JNI_FALSE);
4303 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004304 if (_exception) {
4305 jniThrowException(_env, _exceptionType, _exceptionMessage);
4306 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004307}
4308
4309/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */
4310static void
4311android_glBufferSubData__IIILjava_nio_Buffer_2
4312 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004313 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004314 const char * _exceptionType = NULL;
4315 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004316 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004317 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004318 jint _remaining;
4319 GLvoid *data = (GLvoid *) 0;
4320
Romain Guy84cac202016-12-05 12:26:02 -08004321 if (!data_buf) {
4322 _exception = 1;
4323 _exceptionType = "java/lang/IllegalArgumentException";
4324 _exceptionMessage = "data == null";
4325 goto exit;
4326 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004327 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevichc620a522009-10-21 11:02:44 -07004328 if (_remaining < size) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004329 _exception = 1;
4330 _exceptionType = "java/lang/IllegalArgumentException";
4331 _exceptionMessage = "remaining() < size < needed";
Jack Palevichc620a522009-10-21 11:02:44 -07004332 goto exit;
4333 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004334 if (data == NULL) {
4335 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
4336 data = (GLvoid *) (_dataBase + _bufferOffset);
4337 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004338 glBufferSubData(
4339 (GLenum)target,
4340 (GLintptr)offset,
4341 (GLsizeiptr)size,
4342 (GLvoid *)data
4343 );
Jack Palevichc620a522009-10-21 11:02:44 -07004344
4345exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004346 if (_array) {
4347 releasePointer(_env, _array, data, JNI_FALSE);
4348 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004349 if (_exception) {
4350 jniThrowException(_env, _exceptionType, _exceptionMessage);
4351 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004352}
4353
4354/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4355static void
4356android_glClipPlanef__I_3FI
4357 (JNIEnv *_env, jobject _this, jint plane, jfloatArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004358 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004359 const char * _exceptionType = NULL;
4360 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004361 GLfloat *equation_base = (GLfloat *) 0;
4362 jint _remaining;
4363 GLfloat *equation = (GLfloat *) 0;
4364
4365 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004366 _exception = 1;
4367 _exceptionType = "java/lang/IllegalArgumentException";
4368 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004369 goto exit;
4370 }
4371 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004372 _exception = 1;
4373 _exceptionType = "java/lang/IllegalArgumentException";
4374 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004375 goto exit;
4376 }
4377 _remaining = _env->GetArrayLength(equation_ref) - offset;
4378 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004379 _exception = 1;
4380 _exceptionType = "java/lang/IllegalArgumentException";
4381 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004382 goto exit;
4383 }
4384 equation_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004385 _env->GetFloatArrayElements(equation_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004386 equation = equation_base + offset;
4387
4388 glClipPlanef(
4389 (GLenum)plane,
4390 (GLfloat *)equation
4391 );
4392
4393exit:
4394 if (equation_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004395 _env->ReleaseFloatArrayElements(equation_ref, (jfloat*)equation_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004396 JNI_ABORT);
4397 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004398 if (_exception) {
4399 jniThrowException(_env, _exceptionType, _exceptionMessage);
4400 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004401}
4402
4403/* void glClipPlanef ( GLenum plane, const GLfloat *equation ) */
4404static void
4405android_glClipPlanef__ILjava_nio_FloatBuffer_2
4406 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004407 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004408 const char * _exceptionType = NULL;
4409 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004410 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004411 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004412 jint _remaining;
4413 GLfloat *equation = (GLfloat *) 0;
4414
Romain Guy84cac202016-12-05 12:26:02 -08004415 if (!equation_buf) {
4416 _exception = 1;
4417 _exceptionType = "java/lang/IllegalArgumentException";
4418 _exceptionMessage = "equation == null";
4419 goto exit;
4420 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004421 equation = (GLfloat *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004422 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004423 _exception = 1;
4424 _exceptionType = "java/lang/IllegalArgumentException";
4425 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004426 goto exit;
4427 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004428 if (equation == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004429 char * _equationBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004430 equation = (GLfloat *) (_equationBase + _bufferOffset);
4431 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004432 glClipPlanef(
4433 (GLenum)plane,
4434 (GLfloat *)equation
4435 );
4436
4437exit:
4438 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004439 _env->ReleaseFloatArrayElements(_array, (jfloat*)equation, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004440 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004441 if (_exception) {
4442 jniThrowException(_env, _exceptionType, _exceptionMessage);
4443 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004444}
4445
4446/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4447static void
4448android_glClipPlanex__I_3II
4449 (JNIEnv *_env, jobject _this, jint plane, jintArray equation_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004450 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004451 const char * _exceptionType = NULL;
4452 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004453 GLfixed *equation_base = (GLfixed *) 0;
4454 jint _remaining;
4455 GLfixed *equation = (GLfixed *) 0;
4456
4457 if (!equation_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004458 _exception = 1;
4459 _exceptionType = "java/lang/IllegalArgumentException";
4460 _exceptionMessage = "equation == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004461 goto exit;
4462 }
4463 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004464 _exception = 1;
4465 _exceptionType = "java/lang/IllegalArgumentException";
4466 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004467 goto exit;
4468 }
4469 _remaining = _env->GetArrayLength(equation_ref) - offset;
4470 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004471 _exception = 1;
4472 _exceptionType = "java/lang/IllegalArgumentException";
4473 _exceptionMessage = "length - offset < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004474 goto exit;
4475 }
4476 equation_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004477 _env->GetIntArrayElements(equation_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004478 equation = equation_base + offset;
4479
4480 glClipPlanex(
4481 (GLenum)plane,
4482 (GLfixed *)equation
4483 );
4484
4485exit:
4486 if (equation_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004487 _env->ReleaseIntArrayElements(equation_ref, (jint*)equation_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004488 JNI_ABORT);
4489 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004490 if (_exception) {
4491 jniThrowException(_env, _exceptionType, _exceptionMessage);
4492 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004493}
4494
4495/* void glClipPlanex ( GLenum plane, const GLfixed *equation ) */
4496static void
4497android_glClipPlanex__ILjava_nio_IntBuffer_2
4498 (JNIEnv *_env, jobject _this, jint plane, jobject equation_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004499 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004500 const char * _exceptionType = NULL;
4501 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004502 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004503 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004504 jint _remaining;
4505 GLfixed *equation = (GLfixed *) 0;
4506
Romain Guy84cac202016-12-05 12:26:02 -08004507 if (!equation_buf) {
4508 _exception = 1;
4509 _exceptionType = "java/lang/IllegalArgumentException";
4510 _exceptionMessage = "equation == null";
4511 goto exit;
4512 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004513 equation = (GLfixed *)getPointer(_env, equation_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004514 if (_remaining < 4) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004515 _exception = 1;
4516 _exceptionType = "java/lang/IllegalArgumentException";
4517 _exceptionMessage = "remaining() < 4 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004518 goto exit;
4519 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004520 if (equation == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004521 char * _equationBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004522 equation = (GLfixed *) (_equationBase + _bufferOffset);
4523 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004524 glClipPlanex(
4525 (GLenum)plane,
4526 (GLfixed *)equation
4527 );
4528
4529exit:
4530 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004531 _env->ReleaseIntArrayElements(_array, (jint*)equation, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004532 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004533 if (_exception) {
4534 jniThrowException(_env, _exceptionType, _exceptionMessage);
4535 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004536}
4537
4538/* void glColor4ub ( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha ) */
4539static void
4540android_glColor4ub__BBBB
4541 (JNIEnv *_env, jobject _this, jbyte red, jbyte green, jbyte blue, jbyte alpha) {
4542 glColor4ub(
4543 (GLubyte)red,
4544 (GLubyte)green,
4545 (GLubyte)blue,
4546 (GLubyte)alpha
4547 );
4548}
4549
4550/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
4551static void
4552android_glColorPointer__IIII
4553 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
4554 glColorPointer(
4555 (GLint)size,
4556 (GLenum)type,
4557 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00004558 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004559 );
4560}
4561
4562/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4563static void
4564android_glDeleteBuffers__I_3II
4565 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004566 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004567 const char * _exceptionType = NULL;
4568 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004569 GLuint *buffers_base = (GLuint *) 0;
4570 jint _remaining;
4571 GLuint *buffers = (GLuint *) 0;
4572
4573 if (!buffers_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004574 _exception = 1;
4575 _exceptionType = "java/lang/IllegalArgumentException";
4576 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004577 goto exit;
4578 }
4579 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004580 _exception = 1;
4581 _exceptionType = "java/lang/IllegalArgumentException";
4582 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004583 goto exit;
4584 }
4585 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4586 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004587 _exception = 1;
4588 _exceptionType = "java/lang/IllegalArgumentException";
4589 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004590 goto exit;
4591 }
4592 buffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004593 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004594 buffers = buffers_base + offset;
4595
4596 glDeleteBuffers(
4597 (GLsizei)n,
4598 (GLuint *)buffers
4599 );
4600
4601exit:
4602 if (buffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004603 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004604 JNI_ABORT);
4605 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004606 if (_exception) {
4607 jniThrowException(_env, _exceptionType, _exceptionMessage);
4608 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004609}
4610
4611/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
4612static void
4613android_glDeleteBuffers__ILjava_nio_IntBuffer_2
4614 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004615 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004616 const char * _exceptionType = NULL;
4617 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004618 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004619 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004620 jint _remaining;
4621 GLuint *buffers = (GLuint *) 0;
4622
Romain Guy84cac202016-12-05 12:26:02 -08004623 if (!buffers_buf) {
4624 _exception = 1;
4625 _exceptionType = "java/lang/IllegalArgumentException";
4626 _exceptionMessage = "buffers == null";
4627 goto exit;
4628 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004629 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004630 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004631 _exception = 1;
4632 _exceptionType = "java/lang/IllegalArgumentException";
4633 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004634 goto exit;
4635 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004636 if (buffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004637 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004638 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4639 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004640 glDeleteBuffers(
4641 (GLsizei)n,
4642 (GLuint *)buffers
4643 );
4644
4645exit:
4646 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004647 _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004648 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004649 if (_exception) {
4650 jniThrowException(_env, _exceptionType, _exceptionMessage);
4651 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004652}
4653
4654/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */
4655static void
4656android_glDrawElements__IIII
4657 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004658 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004659 const char * _exceptionType = NULL;
4660 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004661 glDrawElements(
4662 (GLenum)mode,
4663 (GLsizei)count,
4664 (GLenum)type,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00004665 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004666 );
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004667 if (_exception) {
4668 jniThrowException(_env, _exceptionType, _exceptionMessage);
4669 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004670}
4671
4672/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4673static void
4674android_glGenBuffers__I_3II
4675 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
4676 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004677 const char * _exceptionType = NULL;
4678 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004679 GLuint *buffers_base = (GLuint *) 0;
4680 jint _remaining;
4681 GLuint *buffers = (GLuint *) 0;
4682
4683 if (!buffers_ref) {
4684 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004685 _exceptionType = "java/lang/IllegalArgumentException";
4686 _exceptionMessage = "buffers == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004687 goto exit;
4688 }
4689 if (offset < 0) {
4690 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004691 _exceptionType = "java/lang/IllegalArgumentException";
4692 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004693 goto exit;
4694 }
4695 _remaining = _env->GetArrayLength(buffers_ref) - offset;
4696 if (_remaining < n) {
4697 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004698 _exceptionType = "java/lang/IllegalArgumentException";
4699 _exceptionMessage = "length - offset < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004700 goto exit;
4701 }
4702 buffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004703 _env->GetIntArrayElements(buffers_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004704 buffers = buffers_base + offset;
4705
4706 glGenBuffers(
4707 (GLsizei)n,
4708 (GLuint *)buffers
4709 );
4710
4711exit:
4712 if (buffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004713 _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004714 _exception ? JNI_ABORT: 0);
4715 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004716 if (_exception) {
4717 jniThrowException(_env, _exceptionType, _exceptionMessage);
4718 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004719}
4720
4721/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
4722static void
4723android_glGenBuffers__ILjava_nio_IntBuffer_2
4724 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
4725 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004726 const char * _exceptionType = NULL;
4727 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004728 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004729 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004730 jint _remaining;
4731 GLuint *buffers = (GLuint *) 0;
4732
Romain Guy84cac202016-12-05 12:26:02 -08004733 if (!buffers_buf) {
4734 _exception = 1;
4735 _exceptionType = "java/lang/IllegalArgumentException";
4736 _exceptionMessage = "buffers == null";
4737 goto exit;
4738 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004739 buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004740 if (_remaining < n) {
4741 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004742 _exceptionType = "java/lang/IllegalArgumentException";
4743 _exceptionMessage = "remaining() < n < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004744 goto exit;
4745 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004746 if (buffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004747 char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004748 buffers = (GLuint *) (_buffersBase + _bufferOffset);
4749 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004750 glGenBuffers(
4751 (GLsizei)n,
4752 (GLuint *)buffers
4753 );
4754
4755exit:
4756 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004757 _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004758 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004759 if (_exception) {
4760 jniThrowException(_env, _exceptionType, _exceptionMessage);
4761 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004762}
4763
4764/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4765static void
4766android_glGetBooleanv__I_3ZI
4767 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
4768 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004769 const char * _exceptionType = NULL;
4770 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004771 GLboolean *params_base = (GLboolean *) 0;
4772 jint _remaining;
4773 GLboolean *params = (GLboolean *) 0;
4774
4775 if (!params_ref) {
4776 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004777 _exceptionType = "java/lang/IllegalArgumentException";
4778 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004779 goto exit;
4780 }
4781 if (offset < 0) {
4782 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004783 _exceptionType = "java/lang/IllegalArgumentException";
4784 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004785 goto exit;
4786 }
4787 _remaining = _env->GetArrayLength(params_ref) - offset;
4788 params_base = (GLboolean *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004789 _env->GetBooleanArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004790 params = params_base + offset;
4791
4792 glGetBooleanv(
4793 (GLenum)pname,
4794 (GLboolean *)params
4795 );
4796
4797exit:
4798 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004799 _env->ReleaseBooleanArrayElements(params_ref, (jboolean*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004800 _exception ? JNI_ABORT: 0);
4801 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004802 if (_exception) {
4803 jniThrowException(_env, _exceptionType, _exceptionMessage);
4804 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004805}
4806
4807/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
4808static void
4809android_glGetBooleanv__ILjava_nio_IntBuffer_2
4810 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004811 jint _exception = 0;
4812 const char * _exceptionType = NULL;
4813 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004814 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004815 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004816 jint _remaining;
4817 GLboolean *params = (GLboolean *) 0;
4818
Romain Guy84cac202016-12-05 12:26:02 -08004819 if (!params_buf) {
4820 _exception = 1;
4821 _exceptionType = "java/lang/IllegalArgumentException";
4822 _exceptionMessage = "params == null";
4823 goto exit;
4824 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004825 params = (GLboolean *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004826 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004827 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004828 params = (GLboolean *) (_paramsBase + _bufferOffset);
4829 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004830 glGetBooleanv(
4831 (GLenum)pname,
4832 (GLboolean *)params
4833 );
Romain Guy84cac202016-12-05 12:26:02 -08004834
4835exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004836 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004837 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
4838 }
4839 if (_exception) {
4840 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004841 }
4842}
4843
4844/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4845static void
4846android_glGetBufferParameteriv__II_3II
4847 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004848 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004849 "glGetBufferParameteriv");
Orion Hodsonc240f222019-02-26 18:05:03 +00004850 return;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004851}
4852
4853/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
4854static void
4855android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
4856 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07004857 jniThrowException(_env, "java/lang/UnsupportedOperationException",
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004858 "glGetBufferParameteriv");
Orion Hodsonc240f222019-02-26 18:05:03 +00004859 return;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004860}
4861
4862/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4863static void
4864android_glGetClipPlanef__I_3FI
4865 (JNIEnv *_env, jobject _this, jint pname, jfloatArray eqn_ref, jint offset) {
4866 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004867 const char * _exceptionType = NULL;
4868 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004869 GLfloat *eqn_base = (GLfloat *) 0;
4870 jint _remaining;
4871 GLfloat *eqn = (GLfloat *) 0;
4872
4873 if (!eqn_ref) {
4874 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004875 _exceptionType = "java/lang/IllegalArgumentException";
4876 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004877 goto exit;
4878 }
4879 if (offset < 0) {
4880 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004881 _exceptionType = "java/lang/IllegalArgumentException";
4882 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004883 goto exit;
4884 }
4885 _remaining = _env->GetArrayLength(eqn_ref) - offset;
4886 eqn_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004887 _env->GetFloatArrayElements(eqn_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004888 eqn = eqn_base + offset;
4889
4890 glGetClipPlanef(
4891 (GLenum)pname,
4892 (GLfloat *)eqn
4893 );
4894
4895exit:
4896 if (eqn_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004897 _env->ReleaseFloatArrayElements(eqn_ref, (jfloat*)eqn_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004898 _exception ? JNI_ABORT: 0);
4899 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004900 if (_exception) {
4901 jniThrowException(_env, _exceptionType, _exceptionMessage);
4902 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004903}
4904
4905/* void glGetClipPlanef ( GLenum pname, GLfloat *eqn ) */
4906static void
4907android_glGetClipPlanef__ILjava_nio_FloatBuffer_2
4908 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004909 jint _exception = 0;
4910 const char * _exceptionType = NULL;
4911 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004912 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004913 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004914 jint _remaining;
4915 GLfloat *eqn = (GLfloat *) 0;
4916
Romain Guy84cac202016-12-05 12:26:02 -08004917 if (!eqn_buf) {
4918 _exception = 1;
4919 _exceptionType = "java/lang/IllegalArgumentException";
4920 _exceptionMessage = "eqn == null";
4921 goto exit;
4922 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004923 eqn = (GLfloat *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004924 if (eqn == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004925 char * _eqnBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004926 eqn = (GLfloat *) (_eqnBase + _bufferOffset);
4927 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004928 glGetClipPlanef(
4929 (GLenum)pname,
4930 (GLfloat *)eqn
4931 );
Romain Guy84cac202016-12-05 12:26:02 -08004932
4933exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004934 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08004935 _env->ReleaseFloatArrayElements(_array, (jfloat*)eqn, _exception ? JNI_ABORT : 0);
4936 }
4937 if (_exception) {
4938 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004939 }
4940}
4941
4942/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
4943static void
4944android_glGetClipPlanex__I_3II
4945 (JNIEnv *_env, jobject _this, jint pname, jintArray eqn_ref, jint offset) {
4946 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08004947 const char * _exceptionType = NULL;
4948 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004949 GLfixed *eqn_base = (GLfixed *) 0;
4950 jint _remaining;
4951 GLfixed *eqn = (GLfixed *) 0;
4952
4953 if (!eqn_ref) {
4954 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004955 _exceptionType = "java/lang/IllegalArgumentException";
4956 _exceptionMessage = "eqn == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004957 goto exit;
4958 }
4959 if (offset < 0) {
4960 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004961 _exceptionType = "java/lang/IllegalArgumentException";
4962 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004963 goto exit;
4964 }
4965 _remaining = _env->GetArrayLength(eqn_ref) - offset;
4966 eqn_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004967 _env->GetIntArrayElements(eqn_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004968 eqn = eqn_base + offset;
4969
4970 glGetClipPlanex(
4971 (GLenum)pname,
4972 (GLfixed *)eqn
4973 );
4974
4975exit:
4976 if (eqn_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004977 _env->ReleaseIntArrayElements(eqn_ref, (jint*)eqn_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004978 _exception ? JNI_ABORT: 0);
4979 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07004980 if (_exception) {
4981 jniThrowException(_env, _exceptionType, _exceptionMessage);
4982 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004983}
4984
4985/* void glGetClipPlanex ( GLenum pname, GLfixed *eqn ) */
4986static void
4987android_glGetClipPlanex__ILjava_nio_IntBuffer_2
4988 (JNIEnv *_env, jobject _this, jint pname, jobject eqn_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08004989 jint _exception = 0;
4990 const char * _exceptionType = NULL;
4991 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07004992 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07004993 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08004994 jint _remaining;
4995 GLfixed *eqn = (GLfixed *) 0;
4996
Romain Guy84cac202016-12-05 12:26:02 -08004997 if (!eqn_buf) {
4998 _exception = 1;
4999 _exceptionType = "java/lang/IllegalArgumentException";
5000 _exceptionMessage = "eqn == null";
5001 goto exit;
5002 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005003 eqn = (GLfixed *)getPointer(_env, eqn_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005004 if (eqn == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005005 char * _eqnBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005006 eqn = (GLfixed *) (_eqnBase + _bufferOffset);
5007 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005008 glGetClipPlanex(
5009 (GLenum)pname,
5010 (GLfixed *)eqn
5011 );
Romain Guy84cac202016-12-05 12:26:02 -08005012
5013exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005014 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005015 _env->ReleaseIntArrayElements(_array, (jint*)eqn, _exception ? JNI_ABORT : 0);
5016 }
5017 if (_exception) {
5018 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005019 }
5020}
5021
5022/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
5023static void
5024android_glGetFixedv__I_3II
5025 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
5026 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005027 const char * _exceptionType = NULL;
5028 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005029 GLfixed *params_base = (GLfixed *) 0;
5030 jint _remaining;
5031 GLfixed *params = (GLfixed *) 0;
5032
5033 if (!params_ref) {
5034 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005035 _exceptionType = "java/lang/IllegalArgumentException";
5036 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005037 goto exit;
5038 }
5039 if (offset < 0) {
5040 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005041 _exceptionType = "java/lang/IllegalArgumentException";
5042 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005043 goto exit;
5044 }
5045 _remaining = _env->GetArrayLength(params_ref) - offset;
5046 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005047 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005048 params = params_base + offset;
5049
5050 glGetFixedv(
5051 (GLenum)pname,
5052 (GLfixed *)params
5053 );
5054
5055exit:
5056 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005057 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005058 _exception ? JNI_ABORT: 0);
5059 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005060 if (_exception) {
5061 jniThrowException(_env, _exceptionType, _exceptionMessage);
5062 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005063}
5064
5065/* void glGetFixedv ( GLenum pname, GLfixed *params ) */
5066static void
5067android_glGetFixedv__ILjava_nio_IntBuffer_2
5068 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005069 jint _exception = 0;
5070 const char * _exceptionType = NULL;
5071 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005072 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005073 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005074 jint _remaining;
5075 GLfixed *params = (GLfixed *) 0;
5076
Romain Guy84cac202016-12-05 12:26:02 -08005077 if (!params_buf) {
5078 _exception = 1;
5079 _exceptionType = "java/lang/IllegalArgumentException";
5080 _exceptionMessage = "params == null";
5081 goto exit;
5082 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005083 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005084 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005085 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005086 params = (GLfixed *) (_paramsBase + _bufferOffset);
5087 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005088 glGetFixedv(
5089 (GLenum)pname,
5090 (GLfixed *)params
5091 );
Romain Guy84cac202016-12-05 12:26:02 -08005092
5093exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005094 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005095 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
5096 }
5097 if (_exception) {
5098 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005099 }
5100}
5101
5102/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
5103static void
5104android_glGetFloatv__I_3FI
5105 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
5106 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005107 const char * _exceptionType = NULL;
5108 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005109 GLfloat *params_base = (GLfloat *) 0;
5110 jint _remaining;
5111 GLfloat *params = (GLfloat *) 0;
5112
5113 if (!params_ref) {
5114 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005115 _exceptionType = "java/lang/IllegalArgumentException";
5116 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005117 goto exit;
5118 }
5119 if (offset < 0) {
5120 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005121 _exceptionType = "java/lang/IllegalArgumentException";
5122 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005123 goto exit;
5124 }
5125 _remaining = _env->GetArrayLength(params_ref) - offset;
5126 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005127 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005128 params = params_base + offset;
5129
5130 glGetFloatv(
5131 (GLenum)pname,
5132 (GLfloat *)params
5133 );
5134
5135exit:
5136 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005137 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005138 _exception ? JNI_ABORT: 0);
5139 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005140 if (_exception) {
5141 jniThrowException(_env, _exceptionType, _exceptionMessage);
5142 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005143}
5144
5145/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
5146static void
5147android_glGetFloatv__ILjava_nio_FloatBuffer_2
5148 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08005149 jint _exception = 0;
5150 const char * _exceptionType = NULL;
5151 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005152 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005153 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005154 jint _remaining;
5155 GLfloat *params = (GLfloat *) 0;
5156
Romain Guy84cac202016-12-05 12:26:02 -08005157 if (!params_buf) {
5158 _exception = 1;
5159 _exceptionType = "java/lang/IllegalArgumentException";
5160 _exceptionMessage = "params == null";
5161 goto exit;
5162 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005163 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005164 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005165 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005166 params = (GLfloat *) (_paramsBase + _bufferOffset);
5167 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005168 glGetFloatv(
5169 (GLenum)pname,
5170 (GLfloat *)params
5171 );
Romain Guy84cac202016-12-05 12:26:02 -08005172
5173exit:
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005174 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08005175 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
5176 }
5177 if (_exception) {
5178 jniThrowException(_env, _exceptionType, _exceptionMessage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005179 }
5180}
5181
5182/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
5183static void
5184android_glGetLightfv__II_3FI
5185 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
5186 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005187 const char * _exceptionType = NULL;
5188 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005189 GLfloat *params_base = (GLfloat *) 0;
5190 jint _remaining;
5191 GLfloat *params = (GLfloat *) 0;
5192
5193 if (!params_ref) {
5194 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005195 _exceptionType = "java/lang/IllegalArgumentException";
5196 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005197 goto exit;
5198 }
5199 if (offset < 0) {
5200 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005201 _exceptionType = "java/lang/IllegalArgumentException";
5202 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005203 goto exit;
5204 }
5205 _remaining = _env->GetArrayLength(params_ref) - offset;
5206 int _needed;
5207 switch (pname) {
5208#if defined(GL_SPOT_EXPONENT)
5209 case GL_SPOT_EXPONENT:
5210#endif // defined(GL_SPOT_EXPONENT)
5211#if defined(GL_SPOT_CUTOFF)
5212 case GL_SPOT_CUTOFF:
5213#endif // defined(GL_SPOT_CUTOFF)
5214#if defined(GL_CONSTANT_ATTENUATION)
5215 case GL_CONSTANT_ATTENUATION:
5216#endif // defined(GL_CONSTANT_ATTENUATION)
5217#if defined(GL_LINEAR_ATTENUATION)
5218 case GL_LINEAR_ATTENUATION:
5219#endif // defined(GL_LINEAR_ATTENUATION)
5220#if defined(GL_QUADRATIC_ATTENUATION)
5221 case GL_QUADRATIC_ATTENUATION:
5222#endif // defined(GL_QUADRATIC_ATTENUATION)
5223 _needed = 1;
5224 break;
5225#if defined(GL_SPOT_DIRECTION)
5226 case GL_SPOT_DIRECTION:
5227#endif // defined(GL_SPOT_DIRECTION)
5228 _needed = 3;
5229 break;
5230#if defined(GL_AMBIENT)
5231 case GL_AMBIENT:
5232#endif // defined(GL_AMBIENT)
5233#if defined(GL_DIFFUSE)
5234 case GL_DIFFUSE:
5235#endif // defined(GL_DIFFUSE)
5236#if defined(GL_SPECULAR)
5237 case GL_SPECULAR:
5238#endif // defined(GL_SPECULAR)
5239#if defined(GL_EMISSION)
5240 case GL_EMISSION:
5241#endif // defined(GL_EMISSION)
5242 _needed = 4;
5243 break;
5244 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005245 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005246 break;
5247 }
5248 if (_remaining < _needed) {
5249 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005250 _exceptionType = "java/lang/IllegalArgumentException";
5251 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005252 goto exit;
5253 }
5254 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005255 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005256 params = params_base + offset;
5257
5258 glGetLightfv(
5259 (GLenum)light,
5260 (GLenum)pname,
5261 (GLfloat *)params
5262 );
5263
5264exit:
5265 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005266 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005267 _exception ? JNI_ABORT: 0);
5268 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005269 if (_exception) {
5270 jniThrowException(_env, _exceptionType, _exceptionMessage);
5271 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005272}
5273
5274/* void glGetLightfv ( GLenum light, GLenum pname, GLfloat *params ) */
5275static void
5276android_glGetLightfv__IILjava_nio_FloatBuffer_2
5277 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5278 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005279 const char * _exceptionType = NULL;
5280 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005281 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005282 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005283 jint _remaining;
5284 GLfloat *params = (GLfloat *) 0;
5285
Romain Guy84cac202016-12-05 12:26:02 -08005286 if (!params_buf) {
5287 _exception = 1;
5288 _exceptionType = "java/lang/IllegalArgumentException";
5289 _exceptionMessage = "params == null";
5290 goto exit;
5291 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005292 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005293 int _needed;
5294 switch (pname) {
5295#if defined(GL_SPOT_EXPONENT)
5296 case GL_SPOT_EXPONENT:
5297#endif // defined(GL_SPOT_EXPONENT)
5298#if defined(GL_SPOT_CUTOFF)
5299 case GL_SPOT_CUTOFF:
5300#endif // defined(GL_SPOT_CUTOFF)
5301#if defined(GL_CONSTANT_ATTENUATION)
5302 case GL_CONSTANT_ATTENUATION:
5303#endif // defined(GL_CONSTANT_ATTENUATION)
5304#if defined(GL_LINEAR_ATTENUATION)
5305 case GL_LINEAR_ATTENUATION:
5306#endif // defined(GL_LINEAR_ATTENUATION)
5307#if defined(GL_QUADRATIC_ATTENUATION)
5308 case GL_QUADRATIC_ATTENUATION:
5309#endif // defined(GL_QUADRATIC_ATTENUATION)
5310 _needed = 1;
5311 break;
5312#if defined(GL_SPOT_DIRECTION)
5313 case GL_SPOT_DIRECTION:
5314#endif // defined(GL_SPOT_DIRECTION)
5315 _needed = 3;
5316 break;
5317#if defined(GL_AMBIENT)
5318 case GL_AMBIENT:
5319#endif // defined(GL_AMBIENT)
5320#if defined(GL_DIFFUSE)
5321 case GL_DIFFUSE:
5322#endif // defined(GL_DIFFUSE)
5323#if defined(GL_SPECULAR)
5324 case GL_SPECULAR:
5325#endif // defined(GL_SPECULAR)
5326#if defined(GL_EMISSION)
5327 case GL_EMISSION:
5328#endif // defined(GL_EMISSION)
5329 _needed = 4;
5330 break;
5331 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005332 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005333 break;
5334 }
5335 if (_remaining < _needed) {
5336 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005337 _exceptionType = "java/lang/IllegalArgumentException";
5338 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005339 goto exit;
5340 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005341 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005342 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005343 params = (GLfloat *) (_paramsBase + _bufferOffset);
5344 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005345 glGetLightfv(
5346 (GLenum)light,
5347 (GLenum)pname,
5348 (GLfloat *)params
5349 );
5350
5351exit:
5352 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005353 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005354 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005355 if (_exception) {
5356 jniThrowException(_env, _exceptionType, _exceptionMessage);
5357 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005358}
5359
5360/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5361static void
5362android_glGetLightxv__II_3II
5363 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
5364 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005365 const char * _exceptionType = NULL;
5366 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005367 GLfixed *params_base = (GLfixed *) 0;
5368 jint _remaining;
5369 GLfixed *params = (GLfixed *) 0;
5370
5371 if (!params_ref) {
5372 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005373 _exceptionType = "java/lang/IllegalArgumentException";
5374 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005375 goto exit;
5376 }
5377 if (offset < 0) {
5378 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005379 _exceptionType = "java/lang/IllegalArgumentException";
5380 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005381 goto exit;
5382 }
5383 _remaining = _env->GetArrayLength(params_ref) - offset;
5384 int _needed;
5385 switch (pname) {
5386#if defined(GL_SPOT_EXPONENT)
5387 case GL_SPOT_EXPONENT:
5388#endif // defined(GL_SPOT_EXPONENT)
5389#if defined(GL_SPOT_CUTOFF)
5390 case GL_SPOT_CUTOFF:
5391#endif // defined(GL_SPOT_CUTOFF)
5392#if defined(GL_CONSTANT_ATTENUATION)
5393 case GL_CONSTANT_ATTENUATION:
5394#endif // defined(GL_CONSTANT_ATTENUATION)
5395#if defined(GL_LINEAR_ATTENUATION)
5396 case GL_LINEAR_ATTENUATION:
5397#endif // defined(GL_LINEAR_ATTENUATION)
5398#if defined(GL_QUADRATIC_ATTENUATION)
5399 case GL_QUADRATIC_ATTENUATION:
5400#endif // defined(GL_QUADRATIC_ATTENUATION)
5401 _needed = 1;
5402 break;
5403#if defined(GL_SPOT_DIRECTION)
5404 case GL_SPOT_DIRECTION:
5405#endif // defined(GL_SPOT_DIRECTION)
5406 _needed = 3;
5407 break;
5408#if defined(GL_AMBIENT)
5409 case GL_AMBIENT:
5410#endif // defined(GL_AMBIENT)
5411#if defined(GL_DIFFUSE)
5412 case GL_DIFFUSE:
5413#endif // defined(GL_DIFFUSE)
5414#if defined(GL_SPECULAR)
5415 case GL_SPECULAR:
5416#endif // defined(GL_SPECULAR)
5417#if defined(GL_EMISSION)
5418 case GL_EMISSION:
5419#endif // defined(GL_EMISSION)
5420 _needed = 4;
5421 break;
5422 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005423 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005424 break;
5425 }
5426 if (_remaining < _needed) {
5427 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005428 _exceptionType = "java/lang/IllegalArgumentException";
5429 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005430 goto exit;
5431 }
5432 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005433 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005434 params = params_base + offset;
5435
5436 glGetLightxv(
5437 (GLenum)light,
5438 (GLenum)pname,
5439 (GLfixed *)params
5440 );
5441
5442exit:
5443 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005444 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005445 _exception ? JNI_ABORT: 0);
5446 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005447 if (_exception) {
5448 jniThrowException(_env, _exceptionType, _exceptionMessage);
5449 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005450}
5451
5452/* void glGetLightxv ( GLenum light, GLenum pname, GLfixed *params ) */
5453static void
5454android_glGetLightxv__IILjava_nio_IntBuffer_2
5455 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
5456 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005457 const char * _exceptionType = NULL;
5458 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005459 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005460 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005461 jint _remaining;
5462 GLfixed *params = (GLfixed *) 0;
5463
Romain Guy84cac202016-12-05 12:26:02 -08005464 if (!params_buf) {
5465 _exception = 1;
5466 _exceptionType = "java/lang/IllegalArgumentException";
5467 _exceptionMessage = "params == null";
5468 goto exit;
5469 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005470 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005471 int _needed;
5472 switch (pname) {
5473#if defined(GL_SPOT_EXPONENT)
5474 case GL_SPOT_EXPONENT:
5475#endif // defined(GL_SPOT_EXPONENT)
5476#if defined(GL_SPOT_CUTOFF)
5477 case GL_SPOT_CUTOFF:
5478#endif // defined(GL_SPOT_CUTOFF)
5479#if defined(GL_CONSTANT_ATTENUATION)
5480 case GL_CONSTANT_ATTENUATION:
5481#endif // defined(GL_CONSTANT_ATTENUATION)
5482#if defined(GL_LINEAR_ATTENUATION)
5483 case GL_LINEAR_ATTENUATION:
5484#endif // defined(GL_LINEAR_ATTENUATION)
5485#if defined(GL_QUADRATIC_ATTENUATION)
5486 case GL_QUADRATIC_ATTENUATION:
5487#endif // defined(GL_QUADRATIC_ATTENUATION)
5488 _needed = 1;
5489 break;
5490#if defined(GL_SPOT_DIRECTION)
5491 case GL_SPOT_DIRECTION:
5492#endif // defined(GL_SPOT_DIRECTION)
5493 _needed = 3;
5494 break;
5495#if defined(GL_AMBIENT)
5496 case GL_AMBIENT:
5497#endif // defined(GL_AMBIENT)
5498#if defined(GL_DIFFUSE)
5499 case GL_DIFFUSE:
5500#endif // defined(GL_DIFFUSE)
5501#if defined(GL_SPECULAR)
5502 case GL_SPECULAR:
5503#endif // defined(GL_SPECULAR)
5504#if defined(GL_EMISSION)
5505 case GL_EMISSION:
5506#endif // defined(GL_EMISSION)
5507 _needed = 4;
5508 break;
5509 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005510 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005511 break;
5512 }
5513 if (_remaining < _needed) {
5514 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005515 _exceptionType = "java/lang/IllegalArgumentException";
5516 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005517 goto exit;
5518 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005519 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005520 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005521 params = (GLfixed *) (_paramsBase + _bufferOffset);
5522 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005523 glGetLightxv(
5524 (GLenum)light,
5525 (GLenum)pname,
5526 (GLfixed *)params
5527 );
5528
5529exit:
5530 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005531 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005532 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005533 if (_exception) {
5534 jniThrowException(_env, _exceptionType, _exceptionMessage);
5535 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005536}
5537
5538/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5539static void
5540android_glGetMaterialfv__II_3FI
5541 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
5542 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005543 const char * _exceptionType = NULL;
5544 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005545 GLfloat *params_base = (GLfloat *) 0;
5546 jint _remaining;
5547 GLfloat *params = (GLfloat *) 0;
5548
5549 if (!params_ref) {
5550 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005551 _exceptionType = "java/lang/IllegalArgumentException";
5552 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005553 goto exit;
5554 }
5555 if (offset < 0) {
5556 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005557 _exceptionType = "java/lang/IllegalArgumentException";
5558 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005559 goto exit;
5560 }
5561 _remaining = _env->GetArrayLength(params_ref) - offset;
5562 int _needed;
5563 switch (pname) {
5564#if defined(GL_SHININESS)
5565 case GL_SHININESS:
5566#endif // defined(GL_SHININESS)
5567 _needed = 1;
5568 break;
5569#if defined(GL_AMBIENT)
5570 case GL_AMBIENT:
5571#endif // defined(GL_AMBIENT)
5572#if defined(GL_DIFFUSE)
5573 case GL_DIFFUSE:
5574#endif // defined(GL_DIFFUSE)
5575#if defined(GL_SPECULAR)
5576 case GL_SPECULAR:
5577#endif // defined(GL_SPECULAR)
5578#if defined(GL_EMISSION)
5579 case GL_EMISSION:
5580#endif // defined(GL_EMISSION)
5581#if defined(GL_AMBIENT_AND_DIFFUSE)
5582 case GL_AMBIENT_AND_DIFFUSE:
5583#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5584 _needed = 4;
5585 break;
5586 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005587 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005588 break;
5589 }
5590 if (_remaining < _needed) {
5591 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005592 _exceptionType = "java/lang/IllegalArgumentException";
5593 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005594 goto exit;
5595 }
5596 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005597 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005598 params = params_base + offset;
5599
5600 glGetMaterialfv(
5601 (GLenum)face,
5602 (GLenum)pname,
5603 (GLfloat *)params
5604 );
5605
5606exit:
5607 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005608 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005609 _exception ? JNI_ABORT: 0);
5610 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005611 if (_exception) {
5612 jniThrowException(_env, _exceptionType, _exceptionMessage);
5613 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005614}
5615
5616/* void glGetMaterialfv ( GLenum face, GLenum pname, GLfloat *params ) */
5617static void
5618android_glGetMaterialfv__IILjava_nio_FloatBuffer_2
5619 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5620 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005621 const char * _exceptionType = NULL;
5622 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005623 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005624 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005625 jint _remaining;
5626 GLfloat *params = (GLfloat *) 0;
5627
Romain Guy84cac202016-12-05 12:26:02 -08005628 if (!params_buf) {
5629 _exception = 1;
5630 _exceptionType = "java/lang/IllegalArgumentException";
5631 _exceptionMessage = "params == null";
5632 goto exit;
5633 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005634 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005635 int _needed;
5636 switch (pname) {
5637#if defined(GL_SHININESS)
5638 case GL_SHININESS:
5639#endif // defined(GL_SHININESS)
5640 _needed = 1;
5641 break;
5642#if defined(GL_AMBIENT)
5643 case GL_AMBIENT:
5644#endif // defined(GL_AMBIENT)
5645#if defined(GL_DIFFUSE)
5646 case GL_DIFFUSE:
5647#endif // defined(GL_DIFFUSE)
5648#if defined(GL_SPECULAR)
5649 case GL_SPECULAR:
5650#endif // defined(GL_SPECULAR)
5651#if defined(GL_EMISSION)
5652 case GL_EMISSION:
5653#endif // defined(GL_EMISSION)
5654#if defined(GL_AMBIENT_AND_DIFFUSE)
5655 case GL_AMBIENT_AND_DIFFUSE:
5656#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5657 _needed = 4;
5658 break;
5659 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005660 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005661 break;
5662 }
5663 if (_remaining < _needed) {
5664 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005665 _exceptionType = "java/lang/IllegalArgumentException";
5666 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005667 goto exit;
5668 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005669 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005670 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005671 params = (GLfloat *) (_paramsBase + _bufferOffset);
5672 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005673 glGetMaterialfv(
5674 (GLenum)face,
5675 (GLenum)pname,
5676 (GLfloat *)params
5677 );
5678
5679exit:
5680 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005681 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005682 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005683 if (_exception) {
5684 jniThrowException(_env, _exceptionType, _exceptionMessage);
5685 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005686}
5687
5688/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5689static void
5690android_glGetMaterialxv__II_3II
5691 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
5692 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005693 const char * _exceptionType = NULL;
5694 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005695 GLfixed *params_base = (GLfixed *) 0;
5696 jint _remaining;
5697 GLfixed *params = (GLfixed *) 0;
5698
5699 if (!params_ref) {
5700 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005701 _exceptionType = "java/lang/IllegalArgumentException";
5702 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005703 goto exit;
5704 }
5705 if (offset < 0) {
5706 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005707 _exceptionType = "java/lang/IllegalArgumentException";
5708 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005709 goto exit;
5710 }
5711 _remaining = _env->GetArrayLength(params_ref) - offset;
5712 int _needed;
5713 switch (pname) {
5714#if defined(GL_SHININESS)
5715 case GL_SHININESS:
5716#endif // defined(GL_SHININESS)
5717 _needed = 1;
5718 break;
5719#if defined(GL_AMBIENT)
5720 case GL_AMBIENT:
5721#endif // defined(GL_AMBIENT)
5722#if defined(GL_DIFFUSE)
5723 case GL_DIFFUSE:
5724#endif // defined(GL_DIFFUSE)
5725#if defined(GL_SPECULAR)
5726 case GL_SPECULAR:
5727#endif // defined(GL_SPECULAR)
5728#if defined(GL_EMISSION)
5729 case GL_EMISSION:
5730#endif // defined(GL_EMISSION)
5731#if defined(GL_AMBIENT_AND_DIFFUSE)
5732 case GL_AMBIENT_AND_DIFFUSE:
5733#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5734 _needed = 4;
5735 break;
5736 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005737 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005738 break;
5739 }
5740 if (_remaining < _needed) {
5741 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005742 _exceptionType = "java/lang/IllegalArgumentException";
5743 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005744 goto exit;
5745 }
5746 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005747 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005748 params = params_base + offset;
5749
5750 glGetMaterialxv(
5751 (GLenum)face,
5752 (GLenum)pname,
5753 (GLfixed *)params
5754 );
5755
5756exit:
5757 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005758 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005759 _exception ? JNI_ABORT: 0);
5760 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005761 if (_exception) {
5762 jniThrowException(_env, _exceptionType, _exceptionMessage);
5763 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005764}
5765
5766/* void glGetMaterialxv ( GLenum face, GLenum pname, GLfixed *params ) */
5767static void
5768android_glGetMaterialxv__IILjava_nio_IntBuffer_2
5769 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
5770 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005771 const char * _exceptionType = NULL;
5772 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005773 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005774 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005775 jint _remaining;
5776 GLfixed *params = (GLfixed *) 0;
5777
Romain Guy84cac202016-12-05 12:26:02 -08005778 if (!params_buf) {
5779 _exception = 1;
5780 _exceptionType = "java/lang/IllegalArgumentException";
5781 _exceptionMessage = "params == null";
5782 goto exit;
5783 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005784 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005785 int _needed;
5786 switch (pname) {
5787#if defined(GL_SHININESS)
5788 case GL_SHININESS:
5789#endif // defined(GL_SHININESS)
5790 _needed = 1;
5791 break;
5792#if defined(GL_AMBIENT)
5793 case GL_AMBIENT:
5794#endif // defined(GL_AMBIENT)
5795#if defined(GL_DIFFUSE)
5796 case GL_DIFFUSE:
5797#endif // defined(GL_DIFFUSE)
5798#if defined(GL_SPECULAR)
5799 case GL_SPECULAR:
5800#endif // defined(GL_SPECULAR)
5801#if defined(GL_EMISSION)
5802 case GL_EMISSION:
5803#endif // defined(GL_EMISSION)
5804#if defined(GL_AMBIENT_AND_DIFFUSE)
5805 case GL_AMBIENT_AND_DIFFUSE:
5806#endif // defined(GL_AMBIENT_AND_DIFFUSE)
5807 _needed = 4;
5808 break;
5809 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005810 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005811 break;
5812 }
5813 if (_remaining < _needed) {
5814 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005815 _exceptionType = "java/lang/IllegalArgumentException";
5816 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005817 goto exit;
5818 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005819 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005820 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005821 params = (GLfixed *) (_paramsBase + _bufferOffset);
5822 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005823 glGetMaterialxv(
5824 (GLenum)face,
5825 (GLenum)pname,
5826 (GLfixed *)params
5827 );
5828
5829exit:
5830 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005831 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005832 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005833 if (_exception) {
5834 jniThrowException(_env, _exceptionType, _exceptionMessage);
5835 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005836}
5837
5838/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5839static void
5840android_glGetTexEnviv__II_3II
5841 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
5842 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005843 const char * _exceptionType = NULL;
5844 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005845 GLint *params_base = (GLint *) 0;
5846 jint _remaining;
5847 GLint *params = (GLint *) 0;
5848
5849 if (!params_ref) {
5850 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005851 _exceptionType = "java/lang/IllegalArgumentException";
5852 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005853 goto exit;
5854 }
5855 if (offset < 0) {
5856 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005857 _exceptionType = "java/lang/IllegalArgumentException";
5858 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005859 goto exit;
5860 }
5861 _remaining = _env->GetArrayLength(params_ref) - offset;
5862 int _needed;
5863 switch (pname) {
5864#if defined(GL_TEXTURE_ENV_MODE)
5865 case GL_TEXTURE_ENV_MODE:
5866#endif // defined(GL_TEXTURE_ENV_MODE)
5867#if defined(GL_COMBINE_RGB)
5868 case GL_COMBINE_RGB:
5869#endif // defined(GL_COMBINE_RGB)
5870#if defined(GL_COMBINE_ALPHA)
5871 case GL_COMBINE_ALPHA:
5872#endif // defined(GL_COMBINE_ALPHA)
5873 _needed = 1;
5874 break;
5875#if defined(GL_TEXTURE_ENV_COLOR)
5876 case GL_TEXTURE_ENV_COLOR:
5877#endif // defined(GL_TEXTURE_ENV_COLOR)
5878 _needed = 4;
5879 break;
5880 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005881 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005882 break;
5883 }
5884 if (_remaining < _needed) {
5885 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005886 _exceptionType = "java/lang/IllegalArgumentException";
5887 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005888 goto exit;
5889 }
5890 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005891 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005892 params = params_base + offset;
5893
5894 glGetTexEnviv(
5895 (GLenum)env,
5896 (GLenum)pname,
5897 (GLint *)params
5898 );
5899
5900exit:
5901 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005902 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005903 _exception ? JNI_ABORT: 0);
5904 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005905 if (_exception) {
5906 jniThrowException(_env, _exceptionType, _exceptionMessage);
5907 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005908}
5909
5910/* void glGetTexEnviv ( GLenum env, GLenum pname, GLint *params ) */
5911static void
5912android_glGetTexEnviv__IILjava_nio_IntBuffer_2
5913 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
5914 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005915 const char * _exceptionType = NULL;
5916 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005917 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005918 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005919 jint _remaining;
5920 GLint *params = (GLint *) 0;
5921
Romain Guy84cac202016-12-05 12:26:02 -08005922 if (!params_buf) {
5923 _exception = 1;
5924 _exceptionType = "java/lang/IllegalArgumentException";
5925 _exceptionMessage = "params == null";
5926 goto exit;
5927 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005928 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005929 int _needed;
5930 switch (pname) {
5931#if defined(GL_TEXTURE_ENV_MODE)
5932 case GL_TEXTURE_ENV_MODE:
5933#endif // defined(GL_TEXTURE_ENV_MODE)
5934#if defined(GL_COMBINE_RGB)
5935 case GL_COMBINE_RGB:
5936#endif // defined(GL_COMBINE_RGB)
5937#if defined(GL_COMBINE_ALPHA)
5938 case GL_COMBINE_ALPHA:
5939#endif // defined(GL_COMBINE_ALPHA)
5940 _needed = 1;
5941 break;
5942#if defined(GL_TEXTURE_ENV_COLOR)
5943 case GL_TEXTURE_ENV_COLOR:
5944#endif // defined(GL_TEXTURE_ENV_COLOR)
5945 _needed = 4;
5946 break;
5947 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08005948 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005949 break;
5950 }
5951 if (_remaining < _needed) {
5952 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005953 _exceptionType = "java/lang/IllegalArgumentException";
5954 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005955 goto exit;
5956 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005957 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005958 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07005959 params = (GLint *) (_paramsBase + _bufferOffset);
5960 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005961 glGetTexEnviv(
5962 (GLenum)env,
5963 (GLenum)pname,
5964 (GLint *)params
5965 );
5966
5967exit:
5968 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07005969 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005970 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005971 if (_exception) {
5972 jniThrowException(_env, _exceptionType, _exceptionMessage);
5973 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005974}
5975
5976/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
5977static void
5978android_glGetTexEnvxv__II_3II
5979 (JNIEnv *_env, jobject _this, jint env, jint pname, jintArray params_ref, jint offset) {
5980 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08005981 const char * _exceptionType = NULL;
5982 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005983 GLfixed *params_base = (GLfixed *) 0;
5984 jint _remaining;
5985 GLfixed *params = (GLfixed *) 0;
5986
5987 if (!params_ref) {
5988 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005989 _exceptionType = "java/lang/IllegalArgumentException";
5990 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005991 goto exit;
5992 }
5993 if (offset < 0) {
5994 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07005995 _exceptionType = "java/lang/IllegalArgumentException";
5996 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08005997 goto exit;
5998 }
5999 _remaining = _env->GetArrayLength(params_ref) - offset;
6000 int _needed;
6001 switch (pname) {
6002#if defined(GL_TEXTURE_ENV_MODE)
6003 case GL_TEXTURE_ENV_MODE:
6004#endif // defined(GL_TEXTURE_ENV_MODE)
6005#if defined(GL_COMBINE_RGB)
6006 case GL_COMBINE_RGB:
6007#endif // defined(GL_COMBINE_RGB)
6008#if defined(GL_COMBINE_ALPHA)
6009 case GL_COMBINE_ALPHA:
6010#endif // defined(GL_COMBINE_ALPHA)
6011 _needed = 1;
6012 break;
6013#if defined(GL_TEXTURE_ENV_COLOR)
6014 case GL_TEXTURE_ENV_COLOR:
6015#endif // defined(GL_TEXTURE_ENV_COLOR)
6016 _needed = 4;
6017 break;
6018 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006019 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006020 break;
6021 }
6022 if (_remaining < _needed) {
6023 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006024 _exceptionType = "java/lang/IllegalArgumentException";
6025 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006026 goto exit;
6027 }
6028 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006029 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006030 params = params_base + offset;
6031
6032 glGetTexEnvxv(
6033 (GLenum)env,
6034 (GLenum)pname,
6035 (GLfixed *)params
6036 );
6037
6038exit:
6039 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006040 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006041 _exception ? JNI_ABORT: 0);
6042 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006043 if (_exception) {
6044 jniThrowException(_env, _exceptionType, _exceptionMessage);
6045 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006046}
6047
6048/* void glGetTexEnvxv ( GLenum env, GLenum pname, GLfixed *params ) */
6049static void
6050android_glGetTexEnvxv__IILjava_nio_IntBuffer_2
6051 (JNIEnv *_env, jobject _this, jint env, jint pname, jobject params_buf) {
6052 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006053 const char * _exceptionType = NULL;
6054 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006055 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006056 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006057 jint _remaining;
6058 GLfixed *params = (GLfixed *) 0;
6059
Romain Guy84cac202016-12-05 12:26:02 -08006060 if (!params_buf) {
6061 _exception = 1;
6062 _exceptionType = "java/lang/IllegalArgumentException";
6063 _exceptionMessage = "params == null";
6064 goto exit;
6065 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006066 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006067 int _needed;
6068 switch (pname) {
6069#if defined(GL_TEXTURE_ENV_MODE)
6070 case GL_TEXTURE_ENV_MODE:
6071#endif // defined(GL_TEXTURE_ENV_MODE)
6072#if defined(GL_COMBINE_RGB)
6073 case GL_COMBINE_RGB:
6074#endif // defined(GL_COMBINE_RGB)
6075#if defined(GL_COMBINE_ALPHA)
6076 case GL_COMBINE_ALPHA:
6077#endif // defined(GL_COMBINE_ALPHA)
6078 _needed = 1;
6079 break;
6080#if defined(GL_TEXTURE_ENV_COLOR)
6081 case GL_TEXTURE_ENV_COLOR:
6082#endif // defined(GL_TEXTURE_ENV_COLOR)
6083 _needed = 4;
6084 break;
6085 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006086 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006087 break;
6088 }
6089 if (_remaining < _needed) {
6090 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006091 _exceptionType = "java/lang/IllegalArgumentException";
6092 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006093 goto exit;
6094 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006095 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006096 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006097 params = (GLfixed *) (_paramsBase + _bufferOffset);
6098 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006099 glGetTexEnvxv(
6100 (GLenum)env,
6101 (GLenum)pname,
6102 (GLfixed *)params
6103 );
6104
6105exit:
6106 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006107 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006108 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006109 if (_exception) {
6110 jniThrowException(_env, _exceptionType, _exceptionMessage);
6111 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006112}
6113
6114/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
6115static void
6116android_glGetTexParameterfv__II_3FI
6117 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
6118 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006119 const char * _exceptionType = NULL;
6120 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006121 GLfloat *params_base = (GLfloat *) 0;
6122 jint _remaining;
6123 GLfloat *params = (GLfloat *) 0;
6124
6125 if (!params_ref) {
6126 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006127 _exceptionType = "java/lang/IllegalArgumentException";
6128 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006129 goto exit;
6130 }
6131 if (offset < 0) {
6132 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006133 _exceptionType = "java/lang/IllegalArgumentException";
6134 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006135 goto exit;
6136 }
6137 _remaining = _env->GetArrayLength(params_ref) - offset;
6138 if (_remaining < 1) {
6139 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006140 _exceptionType = "java/lang/IllegalArgumentException";
6141 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006142 goto exit;
6143 }
6144 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006145 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006146 params = params_base + offset;
6147
6148 glGetTexParameterfv(
6149 (GLenum)target,
6150 (GLenum)pname,
6151 (GLfloat *)params
6152 );
6153
6154exit:
6155 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006156 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006157 _exception ? JNI_ABORT: 0);
6158 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006159 if (_exception) {
6160 jniThrowException(_env, _exceptionType, _exceptionMessage);
6161 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006162}
6163
6164/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
6165static void
6166android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
6167 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6168 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006169 const char * _exceptionType = NULL;
6170 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006171 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006172 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006173 jint _remaining;
6174 GLfloat *params = (GLfloat *) 0;
6175
Romain Guy84cac202016-12-05 12:26:02 -08006176 if (!params_buf) {
6177 _exception = 1;
6178 _exceptionType = "java/lang/IllegalArgumentException";
6179 _exceptionMessage = "params == null";
6180 goto exit;
6181 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006182 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006183 if (_remaining < 1) {
6184 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006185 _exceptionType = "java/lang/IllegalArgumentException";
6186 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006187 goto exit;
6188 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006189 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006190 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006191 params = (GLfloat *) (_paramsBase + _bufferOffset);
6192 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006193 glGetTexParameterfv(
6194 (GLenum)target,
6195 (GLenum)pname,
6196 (GLfloat *)params
6197 );
6198
6199exit:
6200 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006201 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006202 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006203 if (_exception) {
6204 jniThrowException(_env, _exceptionType, _exceptionMessage);
6205 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006206}
6207
6208/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
6209static void
6210android_glGetTexParameteriv__II_3II
6211 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6212 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006213 const char * _exceptionType = NULL;
6214 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006215 GLint *params_base = (GLint *) 0;
6216 jint _remaining;
6217 GLint *params = (GLint *) 0;
6218
6219 if (!params_ref) {
6220 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006221 _exceptionType = "java/lang/IllegalArgumentException";
6222 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006223 goto exit;
6224 }
6225 if (offset < 0) {
6226 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006227 _exceptionType = "java/lang/IllegalArgumentException";
6228 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006229 goto exit;
6230 }
6231 _remaining = _env->GetArrayLength(params_ref) - offset;
6232 if (_remaining < 1) {
6233 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006234 _exceptionType = "java/lang/IllegalArgumentException";
6235 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006236 goto exit;
6237 }
6238 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006239 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006240 params = params_base + offset;
6241
6242 glGetTexParameteriv(
6243 (GLenum)target,
6244 (GLenum)pname,
6245 (GLint *)params
6246 );
6247
6248exit:
6249 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006250 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006251 _exception ? JNI_ABORT: 0);
6252 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006253 if (_exception) {
6254 jniThrowException(_env, _exceptionType, _exceptionMessage);
6255 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006256}
6257
6258/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
6259static void
6260android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
6261 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6262 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006263 const char * _exceptionType = NULL;
6264 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006265 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006266 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006267 jint _remaining;
6268 GLint *params = (GLint *) 0;
6269
Romain Guy84cac202016-12-05 12:26:02 -08006270 if (!params_buf) {
6271 _exception = 1;
6272 _exceptionType = "java/lang/IllegalArgumentException";
6273 _exceptionMessage = "params == null";
6274 goto exit;
6275 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006276 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006277 if (_remaining < 1) {
6278 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006279 _exceptionType = "java/lang/IllegalArgumentException";
6280 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006281 goto exit;
6282 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006283 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006284 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006285 params = (GLint *) (_paramsBase + _bufferOffset);
6286 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006287 glGetTexParameteriv(
6288 (GLenum)target,
6289 (GLenum)pname,
6290 (GLint *)params
6291 );
6292
6293exit:
6294 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006295 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006296 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006297 if (_exception) {
6298 jniThrowException(_env, _exceptionType, _exceptionMessage);
6299 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006300}
6301
6302/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6303static void
6304android_glGetTexParameterxv__II_3II
6305 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
6306 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006307 const char * _exceptionType = NULL;
6308 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006309 GLfixed *params_base = (GLfixed *) 0;
6310 jint _remaining;
6311 GLfixed *params = (GLfixed *) 0;
6312
6313 if (!params_ref) {
6314 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006315 _exceptionType = "java/lang/IllegalArgumentException";
6316 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006317 goto exit;
6318 }
6319 if (offset < 0) {
6320 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006321 _exceptionType = "java/lang/IllegalArgumentException";
6322 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006323 goto exit;
6324 }
6325 _remaining = _env->GetArrayLength(params_ref) - offset;
6326 if (_remaining < 1) {
6327 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006328 _exceptionType = "java/lang/IllegalArgumentException";
6329 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006330 goto exit;
6331 }
6332 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006333 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006334 params = params_base + offset;
6335
6336 glGetTexParameterxv(
6337 (GLenum)target,
6338 (GLenum)pname,
6339 (GLfixed *)params
6340 );
6341
6342exit:
6343 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006344 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006345 _exception ? JNI_ABORT: 0);
6346 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006347 if (_exception) {
6348 jniThrowException(_env, _exceptionType, _exceptionMessage);
6349 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006350}
6351
6352/* void glGetTexParameterxv ( GLenum target, GLenum pname, GLfixed *params ) */
6353static void
6354android_glGetTexParameterxv__IILjava_nio_IntBuffer_2
6355 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
6356 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006357 const char * _exceptionType = NULL;
6358 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006359 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006360 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006361 jint _remaining;
6362 GLfixed *params = (GLfixed *) 0;
6363
Romain Guy84cac202016-12-05 12:26:02 -08006364 if (!params_buf) {
6365 _exception = 1;
6366 _exceptionType = "java/lang/IllegalArgumentException";
6367 _exceptionMessage = "params == null";
6368 goto exit;
6369 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006370 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006371 if (_remaining < 1) {
6372 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006373 _exceptionType = "java/lang/IllegalArgumentException";
6374 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006375 goto exit;
6376 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006377 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006378 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006379 params = (GLfixed *) (_paramsBase + _bufferOffset);
6380 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006381 glGetTexParameterxv(
6382 (GLenum)target,
6383 (GLenum)pname,
6384 (GLfixed *)params
6385 );
6386
6387exit:
6388 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006389 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006390 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006391 if (_exception) {
6392 jniThrowException(_env, _exceptionType, _exceptionMessage);
6393 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006394}
6395
6396/* GLboolean glIsBuffer ( GLuint buffer ) */
6397static jboolean
6398android_glIsBuffer__I
6399 (JNIEnv *_env, jobject _this, jint buffer) {
6400 GLboolean _returnValue;
6401 _returnValue = glIsBuffer(
6402 (GLuint)buffer
6403 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006404 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006405}
6406
6407/* GLboolean glIsEnabled ( GLenum cap ) */
6408static jboolean
6409android_glIsEnabled__I
6410 (JNIEnv *_env, jobject _this, jint cap) {
6411 GLboolean _returnValue;
6412 _returnValue = glIsEnabled(
6413 (GLenum)cap
6414 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006415 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006416}
6417
6418/* GLboolean glIsTexture ( GLuint texture ) */
6419static jboolean
6420android_glIsTexture__I
6421 (JNIEnv *_env, jobject _this, jint texture) {
6422 GLboolean _returnValue;
6423 _returnValue = glIsTexture(
6424 (GLuint)texture
6425 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07006426 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006427}
6428
6429/* void glNormalPointer ( GLenum type, GLsizei stride, GLint offset ) */
6430static void
6431android_glNormalPointer__III
6432 (JNIEnv *_env, jobject _this, jint type, jint stride, jint offset) {
6433 glNormalPointer(
6434 (GLenum)type,
6435 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00006436 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006437 );
6438}
6439
6440/* void glPointParameterf ( GLenum pname, GLfloat param ) */
6441static void
6442android_glPointParameterf__IF
6443 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
6444 glPointParameterf(
6445 (GLenum)pname,
6446 (GLfloat)param
6447 );
6448}
6449
6450/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6451static void
6452android_glPointParameterfv__I_3FI
6453 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006454 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006455 const char * _exceptionType = NULL;
6456 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006457 GLfloat *params_base = (GLfloat *) 0;
6458 jint _remaining;
6459 GLfloat *params = (GLfloat *) 0;
6460
6461 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006462 _exception = 1;
6463 _exceptionType = "java/lang/IllegalArgumentException";
6464 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006465 goto exit;
6466 }
6467 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006468 _exception = 1;
6469 _exceptionType = "java/lang/IllegalArgumentException";
6470 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006471 goto exit;
6472 }
6473 _remaining = _env->GetArrayLength(params_ref) - offset;
6474 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006475 _exception = 1;
6476 _exceptionType = "java/lang/IllegalArgumentException";
6477 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006478 goto exit;
6479 }
6480 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006481 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006482 params = params_base + offset;
6483
6484 glPointParameterfv(
6485 (GLenum)pname,
6486 (GLfloat *)params
6487 );
6488
6489exit:
6490 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006491 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006492 JNI_ABORT);
6493 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006494 if (_exception) {
6495 jniThrowException(_env, _exceptionType, _exceptionMessage);
6496 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006497}
6498
6499/* void glPointParameterfv ( GLenum pname, const GLfloat *params ) */
6500static void
6501android_glPointParameterfv__ILjava_nio_FloatBuffer_2
6502 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006503 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006504 const char * _exceptionType = NULL;
6505 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006506 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006507 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006508 jint _remaining;
6509 GLfloat *params = (GLfloat *) 0;
6510
Romain Guy84cac202016-12-05 12:26:02 -08006511 if (!params_buf) {
6512 _exception = 1;
6513 _exceptionType = "java/lang/IllegalArgumentException";
6514 _exceptionMessage = "params == null";
6515 goto exit;
6516 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006517 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006518 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006519 _exception = 1;
6520 _exceptionType = "java/lang/IllegalArgumentException";
6521 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006522 goto exit;
6523 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006524 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006525 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006526 params = (GLfloat *) (_paramsBase + _bufferOffset);
6527 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006528 glPointParameterfv(
6529 (GLenum)pname,
6530 (GLfloat *)params
6531 );
6532
6533exit:
6534 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006535 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006536 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006537 if (_exception) {
6538 jniThrowException(_env, _exceptionType, _exceptionMessage);
6539 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006540}
6541
6542/* void glPointParameterx ( GLenum pname, GLfixed param ) */
6543static void
6544android_glPointParameterx__II
6545 (JNIEnv *_env, jobject _this, jint pname, jint param) {
6546 glPointParameterx(
6547 (GLenum)pname,
6548 (GLfixed)param
6549 );
6550}
6551
6552/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6553static void
6554android_glPointParameterxv__I_3II
6555 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006556 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006557 const char * _exceptionType = NULL;
6558 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006559 GLfixed *params_base = (GLfixed *) 0;
6560 jint _remaining;
6561 GLfixed *params = (GLfixed *) 0;
6562
6563 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006564 _exception = 1;
6565 _exceptionType = "java/lang/IllegalArgumentException";
6566 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006567 goto exit;
6568 }
6569 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006570 _exception = 1;
6571 _exceptionType = "java/lang/IllegalArgumentException";
6572 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006573 goto exit;
6574 }
6575 _remaining = _env->GetArrayLength(params_ref) - offset;
6576 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006577 _exception = 1;
6578 _exceptionType = "java/lang/IllegalArgumentException";
6579 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006580 goto exit;
6581 }
6582 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006583 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006584 params = params_base + offset;
6585
6586 glPointParameterxv(
6587 (GLenum)pname,
6588 (GLfixed *)params
6589 );
6590
6591exit:
6592 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006593 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006594 JNI_ABORT);
6595 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006596 if (_exception) {
6597 jniThrowException(_env, _exceptionType, _exceptionMessage);
6598 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006599}
6600
6601/* void glPointParameterxv ( GLenum pname, const GLfixed *params ) */
6602static void
6603android_glPointParameterxv__ILjava_nio_IntBuffer_2
6604 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006605 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006606 const char * _exceptionType = NULL;
6607 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006608 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006609 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006610 jint _remaining;
6611 GLfixed *params = (GLfixed *) 0;
6612
Romain Guy84cac202016-12-05 12:26:02 -08006613 if (!params_buf) {
6614 _exception = 1;
6615 _exceptionType = "java/lang/IllegalArgumentException";
6616 _exceptionMessage = "params == null";
6617 goto exit;
6618 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006619 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006620 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006621 _exception = 1;
6622 _exceptionType = "java/lang/IllegalArgumentException";
6623 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006624 goto exit;
6625 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006626 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006627 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006628 params = (GLfixed *) (_paramsBase + _bufferOffset);
6629 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006630 glPointParameterxv(
6631 (GLenum)pname,
6632 (GLfixed *)params
6633 );
6634
6635exit:
6636 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006637 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006638 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006639 if (_exception) {
6640 jniThrowException(_env, _exceptionType, _exceptionMessage);
6641 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006642}
6643
6644/* void glPointSizePointerOES ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
6645static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08006646android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I
6647 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08006648 jint _exception = 0;
6649 const char * _exceptionType = NULL;
6650 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006651 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006652 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006653 jint _remaining;
6654 GLvoid *pointer = (GLvoid *) 0;
6655
Jack Palevichbe6eac82009-12-08 15:43:51 +08006656 if (pointer_buf) {
6657 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
6658 if ( ! pointer ) {
6659 return;
6660 }
6661 }
6662 glPointSizePointerOESBounds(
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006663 (GLenum)type,
6664 (GLsizei)stride,
Jack Palevichbe6eac82009-12-08 15:43:51 +08006665 (GLvoid *)pointer,
6666 (GLsizei)remaining
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006667 );
Romain Guy84cac202016-12-05 12:26:02 -08006668 if (_exception) {
6669 jniThrowException(_env, _exceptionType, _exceptionMessage);
6670 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006671}
6672
6673/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
6674static void
6675android_glTexCoordPointer__IIII
6676 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
6677 glTexCoordPointer(
6678 (GLint)size,
6679 (GLenum)type,
6680 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00006681 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006682 );
6683}
6684
6685/* void glTexEnvi ( GLenum target, GLenum pname, GLint param ) */
6686static void
6687android_glTexEnvi__III
6688 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6689 glTexEnvi(
6690 (GLenum)target,
6691 (GLenum)pname,
6692 (GLint)param
6693 );
6694}
6695
6696/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6697static void
6698android_glTexEnviv__II_3II
6699 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006700 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006701 const char * _exceptionType = NULL;
6702 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006703 GLint *params_base = (GLint *) 0;
6704 jint _remaining;
6705 GLint *params = (GLint *) 0;
6706
6707 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006708 _exception = 1;
6709 _exceptionType = "java/lang/IllegalArgumentException";
6710 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006711 goto exit;
6712 }
6713 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006714 _exception = 1;
6715 _exceptionType = "java/lang/IllegalArgumentException";
6716 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006717 goto exit;
6718 }
6719 _remaining = _env->GetArrayLength(params_ref) - offset;
6720 int _needed;
6721 switch (pname) {
6722#if defined(GL_TEXTURE_ENV_MODE)
6723 case GL_TEXTURE_ENV_MODE:
6724#endif // defined(GL_TEXTURE_ENV_MODE)
6725#if defined(GL_COMBINE_RGB)
6726 case GL_COMBINE_RGB:
6727#endif // defined(GL_COMBINE_RGB)
6728#if defined(GL_COMBINE_ALPHA)
6729 case GL_COMBINE_ALPHA:
6730#endif // defined(GL_COMBINE_ALPHA)
6731 _needed = 1;
6732 break;
6733#if defined(GL_TEXTURE_ENV_COLOR)
6734 case GL_TEXTURE_ENV_COLOR:
6735#endif // defined(GL_TEXTURE_ENV_COLOR)
6736 _needed = 4;
6737 break;
6738 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006739 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006740 break;
6741 }
6742 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006743 _exception = 1;
6744 _exceptionType = "java/lang/IllegalArgumentException";
6745 _exceptionMessage = "length - offset < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006746 goto exit;
6747 }
6748 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006749 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006750 params = params_base + offset;
6751
6752 glTexEnviv(
6753 (GLenum)target,
6754 (GLenum)pname,
6755 (GLint *)params
6756 );
6757
6758exit:
6759 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006760 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006761 JNI_ABORT);
6762 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006763 if (_exception) {
6764 jniThrowException(_env, _exceptionType, _exceptionMessage);
6765 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006766}
6767
6768/* void glTexEnviv ( GLenum target, GLenum pname, const GLint *params ) */
6769static void
6770android_glTexEnviv__IILjava_nio_IntBuffer_2
6771 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006772 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006773 const char * _exceptionType = NULL;
6774 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006775 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006776 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006777 jint _remaining;
6778 GLint *params = (GLint *) 0;
6779
Romain Guy84cac202016-12-05 12:26:02 -08006780 if (!params_buf) {
6781 _exception = 1;
6782 _exceptionType = "java/lang/IllegalArgumentException";
6783 _exceptionMessage = "params == null";
6784 goto exit;
6785 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006786 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006787 int _needed;
6788 switch (pname) {
6789#if defined(GL_TEXTURE_ENV_MODE)
6790 case GL_TEXTURE_ENV_MODE:
6791#endif // defined(GL_TEXTURE_ENV_MODE)
6792#if defined(GL_COMBINE_RGB)
6793 case GL_COMBINE_RGB:
6794#endif // defined(GL_COMBINE_RGB)
6795#if defined(GL_COMBINE_ALPHA)
6796 case GL_COMBINE_ALPHA:
6797#endif // defined(GL_COMBINE_ALPHA)
6798 _needed = 1;
6799 break;
6800#if defined(GL_TEXTURE_ENV_COLOR)
6801 case GL_TEXTURE_ENV_COLOR:
6802#endif // defined(GL_TEXTURE_ENV_COLOR)
6803 _needed = 4;
6804 break;
6805 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08006806 _needed = 1;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006807 break;
6808 }
6809 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006810 _exception = 1;
6811 _exceptionType = "java/lang/IllegalArgumentException";
6812 _exceptionMessage = "remaining() < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006813 goto exit;
6814 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006815 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006816 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006817 params = (GLint *) (_paramsBase + _bufferOffset);
6818 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006819 glTexEnviv(
6820 (GLenum)target,
6821 (GLenum)pname,
6822 (GLint *)params
6823 );
6824
6825exit:
6826 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006827 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006828 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006829 if (_exception) {
6830 jniThrowException(_env, _exceptionType, _exceptionMessage);
6831 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006832}
6833
6834/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6835static void
6836android_glTexParameterfv__II_3FI
6837 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006838 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006839 const char * _exceptionType = NULL;
6840 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006841 GLfloat *params_base = (GLfloat *) 0;
6842 jint _remaining;
6843 GLfloat *params = (GLfloat *) 0;
6844
6845 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006846 _exception = 1;
6847 _exceptionType = "java/lang/IllegalArgumentException";
6848 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006849 goto exit;
6850 }
6851 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006852 _exception = 1;
6853 _exceptionType = "java/lang/IllegalArgumentException";
6854 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006855 goto exit;
6856 }
6857 _remaining = _env->GetArrayLength(params_ref) - offset;
6858 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006859 _exception = 1;
6860 _exceptionType = "java/lang/IllegalArgumentException";
6861 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006862 goto exit;
6863 }
6864 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006865 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006866 params = params_base + offset;
6867
6868 glTexParameterfv(
6869 (GLenum)target,
6870 (GLenum)pname,
6871 (GLfloat *)params
6872 );
6873
6874exit:
6875 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006876 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006877 JNI_ABORT);
6878 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006879 if (_exception) {
6880 jniThrowException(_env, _exceptionType, _exceptionMessage);
6881 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006882}
6883
6884/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
6885static void
6886android_glTexParameterfv__IILjava_nio_FloatBuffer_2
6887 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006888 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006889 const char * _exceptionType = NULL;
6890 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006891 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006892 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006893 jint _remaining;
6894 GLfloat *params = (GLfloat *) 0;
6895
Romain Guy84cac202016-12-05 12:26:02 -08006896 if (!params_buf) {
6897 _exception = 1;
6898 _exceptionType = "java/lang/IllegalArgumentException";
6899 _exceptionMessage = "params == null";
6900 goto exit;
6901 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006902 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006903 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006904 _exception = 1;
6905 _exceptionType = "java/lang/IllegalArgumentException";
6906 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006907 goto exit;
6908 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006909 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006910 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006911 params = (GLfloat *) (_paramsBase + _bufferOffset);
6912 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006913 glTexParameterfv(
6914 (GLenum)target,
6915 (GLenum)pname,
6916 (GLfloat *)params
6917 );
6918
6919exit:
6920 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006921 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006922 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006923 if (_exception) {
6924 jniThrowException(_env, _exceptionType, _exceptionMessage);
6925 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006926}
6927
6928/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */
6929static void
6930android_glTexParameteri__III
6931 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
6932 glTexParameteri(
6933 (GLenum)target,
6934 (GLenum)pname,
6935 (GLint)param
6936 );
6937}
6938
6939/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
6940static void
6941android_glTexParameteriv__II_3II
6942 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006946 GLint *params_base = (GLint *) 0;
6947 jint _remaining;
6948 GLint *params = (GLint *) 0;
6949
6950 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006951 _exception = 1;
6952 _exceptionType = "java/lang/IllegalArgumentException";
6953 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006954 goto exit;
6955 }
6956 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006957 _exception = 1;
6958 _exceptionType = "java/lang/IllegalArgumentException";
6959 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006960 goto exit;
6961 }
6962 _remaining = _env->GetArrayLength(params_ref) - offset;
6963 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006964 _exception = 1;
6965 _exceptionType = "java/lang/IllegalArgumentException";
6966 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006967 goto exit;
6968 }
6969 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006970 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006971 params = params_base + offset;
6972
6973 glTexParameteriv(
6974 (GLenum)target,
6975 (GLenum)pname,
6976 (GLint *)params
6977 );
6978
6979exit:
6980 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006981 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006982 JNI_ABORT);
6983 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006984 if (_exception) {
6985 jniThrowException(_env, _exceptionType, _exceptionMessage);
6986 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006987}
6988
6989/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
6990static void
6991android_glTexParameteriv__IILjava_nio_IntBuffer_2
6992 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07006993 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08006994 const char * _exceptionType = NULL;
6995 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07006996 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07006997 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08006998 jint _remaining;
6999 GLint *params = (GLint *) 0;
7000
Romain Guy84cac202016-12-05 12:26:02 -08007001 if (!params_buf) {
7002 _exception = 1;
7003 _exceptionType = "java/lang/IllegalArgumentException";
7004 _exceptionMessage = "params == null";
7005 goto exit;
7006 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007007 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007008 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007009 _exception = 1;
7010 _exceptionType = "java/lang/IllegalArgumentException";
7011 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007012 goto exit;
7013 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007014 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007015 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007016 params = (GLint *) (_paramsBase + _bufferOffset);
7017 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007018 glTexParameteriv(
7019 (GLenum)target,
7020 (GLenum)pname,
7021 (GLint *)params
7022 );
7023
7024exit:
7025 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007026 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007027 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007028 if (_exception) {
7029 jniThrowException(_env, _exceptionType, _exceptionMessage);
7030 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007031}
7032
7033/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
7034static void
7035android_glTexParameterxv__II_3II
7036 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007037 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007038 const char * _exceptionType = NULL;
7039 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007040 GLfixed *params_base = (GLfixed *) 0;
7041 jint _remaining;
7042 GLfixed *params = (GLfixed *) 0;
7043
7044 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007045 _exception = 1;
7046 _exceptionType = "java/lang/IllegalArgumentException";
7047 _exceptionMessage = "params == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007048 goto exit;
7049 }
7050 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007051 _exception = 1;
7052 _exceptionType = "java/lang/IllegalArgumentException";
7053 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007054 goto exit;
7055 }
7056 _remaining = _env->GetArrayLength(params_ref) - offset;
7057 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007058 _exception = 1;
7059 _exceptionType = "java/lang/IllegalArgumentException";
7060 _exceptionMessage = "length - offset < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007061 goto exit;
7062 }
7063 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007064 _env->GetIntArrayElements(params_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007065 params = params_base + offset;
7066
7067 glTexParameterxv(
7068 (GLenum)target,
7069 (GLenum)pname,
7070 (GLfixed *)params
7071 );
7072
7073exit:
7074 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007075 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007076 JNI_ABORT);
7077 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007078 if (_exception) {
7079 jniThrowException(_env, _exceptionType, _exceptionMessage);
7080 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007081}
7082
7083/* void glTexParameterxv ( GLenum target, GLenum pname, const GLfixed *params ) */
7084static void
7085android_glTexParameterxv__IILjava_nio_IntBuffer_2
7086 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007087 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007088 const char * _exceptionType = NULL;
7089 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007090 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007091 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007092 jint _remaining;
7093 GLfixed *params = (GLfixed *) 0;
7094
Romain Guy84cac202016-12-05 12:26:02 -08007095 if (!params_buf) {
7096 _exception = 1;
7097 _exceptionType = "java/lang/IllegalArgumentException";
7098 _exceptionMessage = "params == null";
7099 goto exit;
7100 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007101 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007102 if (_remaining < 1) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007103 _exception = 1;
7104 _exceptionType = "java/lang/IllegalArgumentException";
7105 _exceptionMessage = "remaining() < 1 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007106 goto exit;
7107 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007108 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007109 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007110 params = (GLfixed *) (_paramsBase + _bufferOffset);
7111 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007112 glTexParameterxv(
7113 (GLenum)target,
7114 (GLenum)pname,
7115 (GLfixed *)params
7116 );
7117
7118exit:
7119 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007120 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007121 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007122 if (_exception) {
7123 jniThrowException(_env, _exceptionType, _exceptionMessage);
7124 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007125}
7126
7127/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7128static void
7129android_glVertexPointer__IIII
7130 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
7131 glVertexPointer(
7132 (GLint)size,
7133 (GLenum)type,
7134 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007135 reinterpret_cast<GLvoid *>(offset)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007136 );
7137}
7138
7139/* void glCurrentPaletteMatrixOES ( GLuint matrixpaletteindex ) */
7140static void
7141android_glCurrentPaletteMatrixOES__I
7142 (JNIEnv *_env, jobject _this, jint matrixpaletteindex) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007143 glCurrentPaletteMatrixOES(
7144 (GLuint)matrixpaletteindex
7145 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007146}
7147
7148/* void glDrawTexfOES ( GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height ) */
7149static void
7150android_glDrawTexfOES__FFFFF
7151 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z, jfloat width, jfloat height) {
7152 glDrawTexfOES(
7153 (GLfloat)x,
7154 (GLfloat)y,
7155 (GLfloat)z,
7156 (GLfloat)width,
7157 (GLfloat)height
7158 );
7159}
7160
7161/* void glDrawTexfvOES ( const GLfloat *coords ) */
7162static void
7163android_glDrawTexfvOES___3FI
7164 (JNIEnv *_env, jobject _this, jfloatArray coords_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007165 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007166 const char * _exceptionType = NULL;
7167 const char * _exceptionMessage = NULL;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007168 GLfloat *coords_base = (GLfloat *) 0;
7169 jint _remaining;
7170 GLfloat *coords = (GLfloat *) 0;
7171
7172 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007173 _exception = 1;
7174 _exceptionType = "java/lang/IllegalArgumentException";
7175 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007176 goto exit;
7177 }
7178 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007179 _exception = 1;
7180 _exceptionType = "java/lang/IllegalArgumentException";
7181 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007182 goto exit;
7183 }
7184 _remaining = _env->GetArrayLength(coords_ref) - offset;
7185 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007186 _exception = 1;
7187 _exceptionType = "java/lang/IllegalArgumentException";
7188 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007189 goto exit;
7190 }
7191 coords_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007192 _env->GetFloatArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007193 coords = coords_base + offset;
7194
7195 glDrawTexfvOES(
7196 (GLfloat *)coords
7197 );
7198
7199exit:
7200 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007201 _env->ReleaseFloatArrayElements(coords_ref, (jfloat*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007202 JNI_ABORT);
7203 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007204 if (_exception) {
7205 jniThrowException(_env, _exceptionType, _exceptionMessage);
7206 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007207}
7208
7209/* void glDrawTexfvOES ( const GLfloat *coords ) */
7210static void
7211android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2
7212 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007213 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007214 const char * _exceptionType = NULL;
7215 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007216 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007217 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007218 jint _remaining;
7219 GLfloat *coords = (GLfloat *) 0;
7220
Romain Guy84cac202016-12-05 12:26:02 -08007221 if (!coords_buf) {
7222 _exception = 1;
7223 _exceptionType = "java/lang/IllegalArgumentException";
7224 _exceptionMessage = "coords == null";
7225 goto exit;
7226 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007227 coords = (GLfloat *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007228 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007229 _exception = 1;
7230 _exceptionType = "java/lang/IllegalArgumentException";
7231 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007232 goto exit;
7233 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007234 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007235 char * _coordsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007236 coords = (GLfloat *) (_coordsBase + _bufferOffset);
7237 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007238 glDrawTexfvOES(
7239 (GLfloat *)coords
7240 );
7241
7242exit:
7243 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007244 _env->ReleaseFloatArrayElements(_array, (jfloat*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007245 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007246 if (_exception) {
7247 jniThrowException(_env, _exceptionType, _exceptionMessage);
7248 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007249}
7250
7251/* void glDrawTexiOES ( GLint x, GLint y, GLint z, GLint width, GLint height ) */
7252static void
7253android_glDrawTexiOES__IIIII
7254 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7255 glDrawTexiOES(
7256 (GLint)x,
7257 (GLint)y,
7258 (GLint)z,
7259 (GLint)width,
7260 (GLint)height
7261 );
7262}
7263
7264/* void glDrawTexivOES ( const GLint *coords ) */
7265static void
7266android_glDrawTexivOES___3II
7267 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007271 GLint *coords_base = (GLint *) 0;
7272 jint _remaining;
7273 GLint *coords = (GLint *) 0;
7274
7275 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007276 _exception = 1;
7277 _exceptionType = "java/lang/IllegalArgumentException";
7278 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007279 goto exit;
7280 }
7281 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007282 _exception = 1;
7283 _exceptionType = "java/lang/IllegalArgumentException";
7284 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007285 goto exit;
7286 }
7287 _remaining = _env->GetArrayLength(coords_ref) - offset;
7288 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007289 _exception = 1;
7290 _exceptionType = "java/lang/IllegalArgumentException";
7291 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007292 goto exit;
7293 }
7294 coords_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007295 _env->GetIntArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007296 coords = coords_base + offset;
7297
7298 glDrawTexivOES(
7299 (GLint *)coords
7300 );
7301
7302exit:
7303 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007304 _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007305 JNI_ABORT);
7306 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007307 if (_exception) {
7308 jniThrowException(_env, _exceptionType, _exceptionMessage);
7309 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007310}
7311
7312/* void glDrawTexivOES ( const GLint *coords ) */
7313static void
7314android_glDrawTexivOES__Ljava_nio_IntBuffer_2
7315 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007316 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007317 const char * _exceptionType = NULL;
7318 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007319 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007320 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007321 jint _remaining;
7322 GLint *coords = (GLint *) 0;
7323
Romain Guy84cac202016-12-05 12:26:02 -08007324 if (!coords_buf) {
7325 _exception = 1;
7326 _exceptionType = "java/lang/IllegalArgumentException";
7327 _exceptionMessage = "coords == null";
7328 goto exit;
7329 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007330 coords = (GLint *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007331 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007332 _exception = 1;
7333 _exceptionType = "java/lang/IllegalArgumentException";
7334 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007335 goto exit;
7336 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007337 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007338 char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007339 coords = (GLint *) (_coordsBase + _bufferOffset);
7340 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007341 glDrawTexivOES(
7342 (GLint *)coords
7343 );
7344
7345exit:
7346 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007347 _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007348 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007349 if (_exception) {
7350 jniThrowException(_env, _exceptionType, _exceptionMessage);
7351 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007352}
7353
7354/* void glDrawTexsOES ( GLshort x, GLshort y, GLshort z, GLshort width, GLshort height ) */
7355static void
7356android_glDrawTexsOES__SSSSS
7357 (JNIEnv *_env, jobject _this, jshort x, jshort y, jshort z, jshort width, jshort height) {
7358 glDrawTexsOES(
7359 (GLshort)x,
7360 (GLshort)y,
7361 (GLshort)z,
7362 (GLshort)width,
7363 (GLshort)height
7364 );
7365}
7366
7367/* void glDrawTexsvOES ( const GLshort *coords ) */
7368static void
7369android_glDrawTexsvOES___3SI
7370 (JNIEnv *_env, jobject _this, jshortArray coords_ref, jint offset) {
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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007374 GLshort *coords_base = (GLshort *) 0;
7375 jint _remaining;
7376 GLshort *coords = (GLshort *) 0;
7377
7378 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007379 _exception = 1;
7380 _exceptionType = "java/lang/IllegalArgumentException";
7381 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007382 goto exit;
7383 }
7384 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007385 _exception = 1;
7386 _exceptionType = "java/lang/IllegalArgumentException";
7387 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007388 goto exit;
7389 }
7390 _remaining = _env->GetArrayLength(coords_ref) - offset;
7391 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007392 _exception = 1;
7393 _exceptionType = "java/lang/IllegalArgumentException";
7394 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007395 goto exit;
7396 }
7397 coords_base = (GLshort *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007398 _env->GetShortArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007399 coords = coords_base + offset;
7400
7401 glDrawTexsvOES(
7402 (GLshort *)coords
7403 );
7404
7405exit:
7406 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007407 _env->ReleaseShortArrayElements(coords_ref, (jshort*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007408 JNI_ABORT);
7409 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007410 if (_exception) {
7411 jniThrowException(_env, _exceptionType, _exceptionMessage);
7412 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007413}
7414
7415/* void glDrawTexsvOES ( const GLshort *coords ) */
7416static void
7417android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2
7418 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007419 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007420 const char * _exceptionType = NULL;
7421 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007422 jshortArray _array = (jshortArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007423 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007424 jint _remaining;
7425 GLshort *coords = (GLshort *) 0;
7426
Romain Guy84cac202016-12-05 12:26:02 -08007427 if (!coords_buf) {
7428 _exception = 1;
7429 _exceptionType = "java/lang/IllegalArgumentException";
7430 _exceptionMessage = "coords == null";
7431 goto exit;
7432 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007433 coords = (GLshort *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007434 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007435 _exception = 1;
7436 _exceptionType = "java/lang/IllegalArgumentException";
7437 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007438 goto exit;
7439 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007440 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007441 char * _coordsBase = (char *)_env->GetShortArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007442 coords = (GLshort *) (_coordsBase + _bufferOffset);
7443 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007444 glDrawTexsvOES(
7445 (GLshort *)coords
7446 );
7447
7448exit:
7449 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007450 _env->ReleaseShortArrayElements(_array, (jshort*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007451 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007452 if (_exception) {
7453 jniThrowException(_env, _exceptionType, _exceptionMessage);
7454 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007455}
7456
7457/* void glDrawTexxOES ( GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height ) */
7458static void
7459android_glDrawTexxOES__IIIII
7460 (JNIEnv *_env, jobject _this, jint x, jint y, jint z, jint width, jint height) {
7461 glDrawTexxOES(
7462 (GLfixed)x,
7463 (GLfixed)y,
7464 (GLfixed)z,
7465 (GLfixed)width,
7466 (GLfixed)height
7467 );
7468}
7469
7470/* void glDrawTexxvOES ( const GLfixed *coords ) */
7471static void
7472android_glDrawTexxvOES___3II
7473 (JNIEnv *_env, jobject _this, jintArray coords_ref, jint offset) {
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;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007477 GLfixed *coords_base = (GLfixed *) 0;
7478 jint _remaining;
7479 GLfixed *coords = (GLfixed *) 0;
7480
7481 if (!coords_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007482 _exception = 1;
7483 _exceptionType = "java/lang/IllegalArgumentException";
7484 _exceptionMessage = "coords == null";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007485 goto exit;
7486 }
7487 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007488 _exception = 1;
7489 _exceptionType = "java/lang/IllegalArgumentException";
7490 _exceptionMessage = "offset < 0";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007491 goto exit;
7492 }
7493 _remaining = _env->GetArrayLength(coords_ref) - offset;
7494 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007495 _exception = 1;
7496 _exceptionType = "java/lang/IllegalArgumentException";
7497 _exceptionMessage = "length - offset < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007498 goto exit;
7499 }
7500 coords_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007501 _env->GetIntArrayElements(coords_ref, (jboolean *)0);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007502 coords = coords_base + offset;
7503
7504 glDrawTexxvOES(
7505 (GLfixed *)coords
7506 );
7507
7508exit:
7509 if (coords_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007510 _env->ReleaseIntArrayElements(coords_ref, (jint*)coords_base,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007511 JNI_ABORT);
7512 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007513 if (_exception) {
7514 jniThrowException(_env, _exceptionType, _exceptionMessage);
7515 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007516}
7517
7518/* void glDrawTexxvOES ( const GLfixed *coords ) */
7519static void
7520android_glDrawTexxvOES__Ljava_nio_IntBuffer_2
7521 (JNIEnv *_env, jobject _this, jobject coords_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007522 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007523 const char * _exceptionType = NULL;
7524 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007525 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007526 jint _bufferOffset = (jint) 0;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007527 jint _remaining;
7528 GLfixed *coords = (GLfixed *) 0;
7529
Romain Guy84cac202016-12-05 12:26:02 -08007530 if (!coords_buf) {
7531 _exception = 1;
7532 _exceptionType = "java/lang/IllegalArgumentException";
7533 _exceptionMessage = "coords == null";
7534 goto exit;
7535 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007536 coords = (GLfixed *)getPointer(_env, coords_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007537 if (_remaining < 5) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007538 _exception = 1;
7539 _exceptionType = "java/lang/IllegalArgumentException";
7540 _exceptionMessage = "remaining() < 5 < needed";
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007541 goto exit;
7542 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007543 if (coords == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007544 char * _coordsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007545 coords = (GLfixed *) (_coordsBase + _bufferOffset);
7546 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007547 glDrawTexxvOES(
7548 (GLfixed *)coords
7549 );
7550
7551exit:
7552 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007553 _env->ReleaseIntArrayElements(_array, (jint*)coords, JNI_ABORT);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007554 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007555 if (_exception) {
7556 jniThrowException(_env, _exceptionType, _exceptionMessage);
7557 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007558}
7559
7560/* void glLoadPaletteFromModelViewMatrixOES ( void ) */
7561static void
7562android_glLoadPaletteFromModelViewMatrixOES__
7563 (JNIEnv *_env, jobject _this) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007564 glLoadPaletteFromModelViewMatrixOES();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007565}
7566
7567/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7568static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007569android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I
7570 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08007571 jint _exception = 0;
7572 const char * _exceptionType = NULL;
7573 const char * _exceptionMessage = NULL;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007574 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007575 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007576 jint _remaining;
7577 GLvoid *pointer = (GLvoid *) 0;
7578
7579 if (pointer_buf) {
7580 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7581 if ( ! pointer ) {
7582 return;
7583 }
7584 }
7585 glMatrixIndexPointerOESBounds(
7586 (GLint)size,
7587 (GLenum)type,
7588 (GLsizei)stride,
7589 (GLvoid *)pointer,
7590 (GLsizei)remaining
7591 );
Romain Guy84cac202016-12-05 12:26:02 -08007592 if (_exception) {
7593 jniThrowException(_env, _exceptionType, _exceptionMessage);
7594 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007595}
7596
7597/* void glMatrixIndexPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7598static void
7599android_glMatrixIndexPointerOES__IIII
7600 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007601 glMatrixIndexPointerOES(
7602 (GLint)size,
7603 (GLenum)type,
7604 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007605 reinterpret_cast<GLvoid *>(offset)
Jack Palevichbe6eac82009-12-08 15:43:51 +08007606 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007607}
7608
7609/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
7610static void
Jack Palevichbe6eac82009-12-08 15:43:51 +08007611android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I
7612 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08007613 jint _exception = 0;
7614 const char * _exceptionType = NULL;
7615 const char * _exceptionMessage = NULL;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007616 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007617 jint _bufferOffset = (jint) 0;
Jack Palevichbe6eac82009-12-08 15:43:51 +08007618 jint _remaining;
7619 GLvoid *pointer = (GLvoid *) 0;
7620
7621 if (pointer_buf) {
7622 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
7623 if ( ! pointer ) {
7624 return;
7625 }
7626 }
7627 glWeightPointerOESBounds(
7628 (GLint)size,
7629 (GLenum)type,
7630 (GLsizei)stride,
7631 (GLvoid *)pointer,
7632 (GLsizei)remaining
7633 );
Romain Guy84cac202016-12-05 12:26:02 -08007634 if (_exception) {
7635 jniThrowException(_env, _exceptionType, _exceptionMessage);
7636 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007637}
7638
7639/* void glWeightPointerOES ( GLint size, GLenum type, GLsizei stride, GLint offset ) */
7640static void
7641android_glWeightPointerOES__IIII
7642 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jint offset) {
Jack Palevichbe6eac82009-12-08 15:43:51 +08007643 glWeightPointerOES(
7644 (GLint)size,
7645 (GLenum)type,
7646 (GLsizei)stride,
Ashok Bhat01c26ea2014-02-24 09:49:07 +00007647 reinterpret_cast<GLvoid *>(offset)
Jack Palevichbe6eac82009-12-08 15:43:51 +08007648 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007649}
7650
7651/* void glBindFramebufferOES ( GLint target, GLint framebuffer ) */
7652static void
7653android_glBindFramebufferOES__II
7654 (JNIEnv *_env, jobject _this, jint target, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007655 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007656 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007657 "glBindFramebufferOES");
7658 return;
7659 }
7660 glBindFramebufferOES(
7661 (GLint)target,
7662 (GLint)framebuffer
7663 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007664}
7665
7666/* void glBindRenderbufferOES ( GLint target, GLint renderbuffer ) */
7667static void
7668android_glBindRenderbufferOES__II
7669 (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007670 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007671 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007672 "glBindRenderbufferOES");
7673 return;
7674 }
7675 glBindRenderbufferOES(
7676 (GLint)target,
7677 (GLint)renderbuffer
7678 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007679}
7680
7681/* void glBlendEquation ( GLint mode ) */
7682static void
7683android_glBlendEquation__I
7684 (JNIEnv *_env, jobject _this, jint mode) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007685 if (! supportsExtension(_env, _this, have_OES_blend_subtractID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007686 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007687 "glBlendEquation");
7688 return;
7689 }
7690 glBlendEquation(
7691 (GLint)mode
7692 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007693}
7694
7695/* void glBlendEquationSeparate ( GLint modeRGB, GLint modeAlpha ) */
7696static void
7697android_glBlendEquationSeparate__II
7698 (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007699 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007700 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007701 "glBlendEquationSeparate");
7702 return;
7703 }
7704 glBlendEquationSeparate(
7705 (GLint)modeRGB,
7706 (GLint)modeAlpha
7707 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007708}
7709
7710/* void glBlendFuncSeparate ( GLint srcRGB, GLint dstRGB, GLint srcAlpha, GLint dstAlpha ) */
7711static void
7712android_glBlendFuncSeparate__IIII
7713 (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007714 if (! supportsExtension(_env, _this, have_OES_blend_equation_separateID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007715 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007716 "glBlendFuncSeparate");
7717 return;
7718 }
7719 glBlendFuncSeparate(
7720 (GLint)srcRGB,
7721 (GLint)dstRGB,
7722 (GLint)srcAlpha,
7723 (GLint)dstAlpha
7724 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007725}
7726
7727/* GLint glCheckFramebufferStatusOES ( GLint target ) */
7728static jint
7729android_glCheckFramebufferStatusOES__I
7730 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007731 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007732 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007733 "glCheckFramebufferStatusOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007734 return 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007735 }
7736 GLint _returnValue = 0;
7737 _returnValue = glCheckFramebufferStatusOES(
7738 (GLint)target
7739 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07007740 return (jint)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007741}
7742
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007743/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007744static void
7745android_glDeleteFramebuffersOES__I_3II
7746 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007747 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007748 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007749 "glDeleteFramebuffersOES");
7750 return;
7751 }
7752 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007753 const char * _exceptionType = NULL;
7754 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007755 GLuint *framebuffers_base = (GLuint *) 0;
7756 jint _remaining;
7757 GLuint *framebuffers = (GLuint *) 0;
7758
7759 if (!framebuffers_ref) {
7760 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007761 _exceptionType = "java/lang/IllegalArgumentException";
7762 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007763 goto exit;
7764 }
7765 if (offset < 0) {
7766 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007767 _exceptionType = "java/lang/IllegalArgumentException";
7768 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007769 goto exit;
7770 }
7771 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
7772 if (_remaining < n) {
7773 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007774 _exceptionType = "java/lang/IllegalArgumentException";
7775 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007776 goto exit;
7777 }
7778 framebuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007779 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007780 framebuffers = framebuffers_base + offset;
7781
7782 glDeleteFramebuffersOES(
7783 (GLint)n,
7784 (GLuint *)framebuffers
7785 );
7786
7787exit:
7788 if (framebuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007789 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007790 _exception ? JNI_ABORT: 0);
7791 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007792 if (_exception) {
7793 jniThrowException(_env, _exceptionType, _exceptionMessage);
7794 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007795}
7796
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007797/* void glDeleteFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007798static void
7799android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2
7800 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007801 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007802 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007803 "glDeleteFramebuffersOES");
7804 return;
7805 }
7806 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007807 const char * _exceptionType = NULL;
7808 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007809 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007810 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007811 jint _remaining;
7812 GLuint *framebuffers = (GLuint *) 0;
7813
Romain Guy84cac202016-12-05 12:26:02 -08007814 if (!framebuffers_buf) {
7815 _exception = 1;
7816 _exceptionType = "java/lang/IllegalArgumentException";
7817 _exceptionMessage = "framebuffers == null";
7818 goto exit;
7819 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007820 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007821 if (_remaining < n) {
7822 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007823 _exceptionType = "java/lang/IllegalArgumentException";
7824 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007825 goto exit;
7826 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007827 if (framebuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007828 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007829 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
7830 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007831 glDeleteFramebuffersOES(
7832 (GLint)n,
7833 (GLuint *)framebuffers
7834 );
7835
7836exit:
7837 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007838 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007839 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007840 if (_exception) {
7841 jniThrowException(_env, _exceptionType, _exceptionMessage);
7842 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007843}
7844
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007845/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007846static void
7847android_glDeleteRenderbuffersOES__I_3II
7848 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007849 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007850 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007851 "glDeleteRenderbuffersOES");
7852 return;
7853 }
7854 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007855 const char * _exceptionType = NULL;
7856 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007857 GLuint *renderbuffers_base = (GLuint *) 0;
7858 jint _remaining;
7859 GLuint *renderbuffers = (GLuint *) 0;
7860
7861 if (!renderbuffers_ref) {
7862 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007863 _exceptionType = "java/lang/IllegalArgumentException";
7864 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007865 goto exit;
7866 }
7867 if (offset < 0) {
7868 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007869 _exceptionType = "java/lang/IllegalArgumentException";
7870 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007871 goto exit;
7872 }
7873 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
7874 if (_remaining < n) {
7875 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007876 _exceptionType = "java/lang/IllegalArgumentException";
7877 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007878 goto exit;
7879 }
7880 renderbuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007881 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007882 renderbuffers = renderbuffers_base + offset;
7883
7884 glDeleteRenderbuffersOES(
7885 (GLint)n,
7886 (GLuint *)renderbuffers
7887 );
7888
7889exit:
7890 if (renderbuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007891 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007892 _exception ? JNI_ABORT: 0);
7893 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007894 if (_exception) {
7895 jniThrowException(_env, _exceptionType, _exceptionMessage);
7896 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007897}
7898
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007899/* void glDeleteRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007900static void
7901android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2
7902 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007903 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007904 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007905 "glDeleteRenderbuffersOES");
7906 return;
7907 }
7908 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08007909 const char * _exceptionType = NULL;
7910 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007911 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007912 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007913 jint _remaining;
7914 GLuint *renderbuffers = (GLuint *) 0;
7915
Romain Guy84cac202016-12-05 12:26:02 -08007916 if (!renderbuffers_buf) {
7917 _exception = 1;
7918 _exceptionType = "java/lang/IllegalArgumentException";
7919 _exceptionMessage = "renderbuffers == null";
7920 goto exit;
7921 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007922 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007923 if (_remaining < n) {
7924 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007925 _exceptionType = "java/lang/IllegalArgumentException";
7926 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007927 goto exit;
7928 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007929 if (renderbuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007930 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07007931 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
7932 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007933 glDeleteRenderbuffersOES(
7934 (GLint)n,
7935 (GLuint *)renderbuffers
7936 );
7937
7938exit:
7939 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07007940 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007941 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07007942 if (_exception) {
7943 jniThrowException(_env, _exceptionType, _exceptionMessage);
7944 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007945}
7946
7947/* void glFramebufferRenderbufferOES ( GLint target, GLint attachment, GLint renderbuffertarget, GLint renderbuffer ) */
7948static void
7949android_glFramebufferRenderbufferOES__IIII
7950 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007951 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007952 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007953 "glFramebufferRenderbufferOES");
7954 return;
7955 }
7956 glFramebufferRenderbufferOES(
7957 (GLint)target,
7958 (GLint)attachment,
7959 (GLint)renderbuffertarget,
7960 (GLint)renderbuffer
7961 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007962}
7963
7964/* void glFramebufferTexture2DOES ( GLint target, GLint attachment, GLint textarget, GLint texture, GLint level ) */
7965static void
7966android_glFramebufferTexture2DOES__IIIII
7967 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007968 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007969 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007970 "glFramebufferTexture2DOES");
7971 return;
7972 }
7973 glFramebufferTexture2DOES(
7974 (GLint)target,
7975 (GLint)attachment,
7976 (GLint)textarget,
7977 (GLint)texture,
7978 (GLint)level
7979 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007980}
7981
7982/* void glGenerateMipmapOES ( GLint target ) */
7983static void
7984android_glGenerateMipmapOES__I
7985 (JNIEnv *_env, jobject _this, jint target) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007986 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07007987 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007988 "glGenerateMipmapOES");
7989 return;
7990 }
7991 glGenerateMipmapOES(
7992 (GLint)target
7993 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007994}
7995
Jack Palevich8a4de4b2010-01-28 20:28:32 +08007996/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08007997static void
7998android_glGenFramebuffersOES__I_3II
7999 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008000 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008001 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008002 "glGenFramebuffersOES");
8003 return;
8004 }
8005 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008006 const char * _exceptionType = NULL;
8007 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008008 GLuint *framebuffers_base = (GLuint *) 0;
8009 jint _remaining;
8010 GLuint *framebuffers = (GLuint *) 0;
8011
8012 if (!framebuffers_ref) {
8013 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008014 _exceptionType = "java/lang/IllegalArgumentException";
8015 _exceptionMessage = "framebuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008016 goto exit;
8017 }
8018 if (offset < 0) {
8019 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008020 _exceptionType = "java/lang/IllegalArgumentException";
8021 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008022 goto exit;
8023 }
8024 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
8025 if (_remaining < n) {
8026 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008027 _exceptionType = "java/lang/IllegalArgumentException";
8028 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008029 goto exit;
8030 }
8031 framebuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008032 _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008033 framebuffers = framebuffers_base + offset;
8034
8035 glGenFramebuffersOES(
8036 (GLint)n,
8037 (GLuint *)framebuffers
8038 );
8039
8040exit:
8041 if (framebuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008042 _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008043 _exception ? JNI_ABORT: 0);
8044 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008045 if (_exception) {
8046 jniThrowException(_env, _exceptionType, _exceptionMessage);
8047 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008048}
8049
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008050/* void glGenFramebuffersOES ( GLint n, GLuint *framebuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008051static void
8052android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2
8053 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008054 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008055 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008056 "glGenFramebuffersOES");
8057 return;
8058 }
8059 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008060 const char * _exceptionType = NULL;
8061 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008062 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008063 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008064 jint _remaining;
8065 GLuint *framebuffers = (GLuint *) 0;
8066
Romain Guy84cac202016-12-05 12:26:02 -08008067 if (!framebuffers_buf) {
8068 _exception = 1;
8069 _exceptionType = "java/lang/IllegalArgumentException";
8070 _exceptionMessage = "framebuffers == null";
8071 goto exit;
8072 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008073 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008074 if (_remaining < n) {
8075 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008076 _exceptionType = "java/lang/IllegalArgumentException";
8077 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008078 goto exit;
8079 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008080 if (framebuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008081 char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008082 framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset);
8083 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008084 glGenFramebuffersOES(
8085 (GLint)n,
8086 (GLuint *)framebuffers
8087 );
8088
8089exit:
8090 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008091 _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008092 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008093 if (_exception) {
8094 jniThrowException(_env, _exceptionType, _exceptionMessage);
8095 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008096}
8097
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008098/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008099static void
8100android_glGenRenderbuffersOES__I_3II
8101 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008102 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008103 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008104 "glGenRenderbuffersOES");
8105 return;
8106 }
8107 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008108 const char * _exceptionType = NULL;
8109 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008110 GLuint *renderbuffers_base = (GLuint *) 0;
8111 jint _remaining;
8112 GLuint *renderbuffers = (GLuint *) 0;
8113
8114 if (!renderbuffers_ref) {
8115 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008116 _exceptionType = "java/lang/IllegalArgumentException";
8117 _exceptionMessage = "renderbuffers == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008118 goto exit;
8119 }
8120 if (offset < 0) {
8121 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008122 _exceptionType = "java/lang/IllegalArgumentException";
8123 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008124 goto exit;
8125 }
8126 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
8127 if (_remaining < n) {
8128 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008129 _exceptionType = "java/lang/IllegalArgumentException";
8130 _exceptionMessage = "length - offset < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008131 goto exit;
8132 }
8133 renderbuffers_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008134 _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008135 renderbuffers = renderbuffers_base + offset;
8136
8137 glGenRenderbuffersOES(
8138 (GLint)n,
8139 (GLuint *)renderbuffers
8140 );
8141
8142exit:
8143 if (renderbuffers_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008144 _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008145 _exception ? JNI_ABORT: 0);
8146 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008147 if (_exception) {
8148 jniThrowException(_env, _exceptionType, _exceptionMessage);
8149 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008150}
8151
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008152/* void glGenRenderbuffersOES ( GLint n, GLuint *renderbuffers ) */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008153static void
8154android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2
8155 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008156 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008157 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008158 "glGenRenderbuffersOES");
8159 return;
8160 }
8161 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008162 const char * _exceptionType = NULL;
8163 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008164 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008165 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008166 jint _remaining;
8167 GLuint *renderbuffers = (GLuint *) 0;
8168
Romain Guy84cac202016-12-05 12:26:02 -08008169 if (!renderbuffers_buf) {
8170 _exception = 1;
8171 _exceptionType = "java/lang/IllegalArgumentException";
8172 _exceptionMessage = "renderbuffers == null";
8173 goto exit;
8174 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008175 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008176 if (_remaining < n) {
8177 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008178 _exceptionType = "java/lang/IllegalArgumentException";
8179 _exceptionMessage = "remaining() < n < needed";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008180 goto exit;
8181 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008182 if (renderbuffers == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008183 char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008184 renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset);
8185 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008186 glGenRenderbuffersOES(
8187 (GLint)n,
8188 (GLuint *)renderbuffers
8189 );
8190
8191exit:
8192 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008193 _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008194 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008195 if (_exception) {
8196 jniThrowException(_env, _exceptionType, _exceptionMessage);
8197 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008198}
8199
8200/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
8201static void
8202android_glGetFramebufferAttachmentParameterivOES__III_3II
8203 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008204 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008205 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008206 "glGetFramebufferAttachmentParameterivOES");
8207 return;
8208 }
8209 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008210 const char * _exceptionType = NULL;
8211 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008212 GLint *params_base = (GLint *) 0;
8213 jint _remaining;
8214 GLint *params = (GLint *) 0;
8215
8216 if (!params_ref) {
8217 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008218 _exceptionType = "java/lang/IllegalArgumentException";
8219 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008220 goto exit;
8221 }
8222 if (offset < 0) {
8223 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008224 _exceptionType = "java/lang/IllegalArgumentException";
8225 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008226 goto exit;
8227 }
8228 _remaining = _env->GetArrayLength(params_ref) - offset;
8229 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008230 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008231 params = params_base + offset;
8232
8233 glGetFramebufferAttachmentParameterivOES(
8234 (GLint)target,
8235 (GLint)attachment,
8236 (GLint)pname,
8237 (GLint *)params
8238 );
8239
8240exit:
8241 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008242 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008243 _exception ? JNI_ABORT: 0);
8244 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008245 if (_exception) {
8246 jniThrowException(_env, _exceptionType, _exceptionMessage);
8247 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008248}
8249
8250/* void glGetFramebufferAttachmentParameterivOES ( GLint target, GLint attachment, GLint pname, GLint *params ) */
8251static void
8252android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2
8253 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008254 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008255 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008256 "glGetFramebufferAttachmentParameterivOES");
8257 return;
8258 }
Romain Guy84cac202016-12-05 12:26:02 -08008259 jint _exception = 0;
8260 const char * _exceptionType = NULL;
8261 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008262 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008263 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008264 jint _remaining;
8265 GLint *params = (GLint *) 0;
8266
Romain Guy84cac202016-12-05 12:26:02 -08008267 if (!params_buf) {
8268 _exception = 1;
8269 _exceptionType = "java/lang/IllegalArgumentException";
8270 _exceptionMessage = "params == null";
8271 goto exit;
8272 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008273 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008274 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008275 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008276 params = (GLint *) (_paramsBase + _bufferOffset);
8277 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008278 glGetFramebufferAttachmentParameterivOES(
8279 (GLint)target,
8280 (GLint)attachment,
8281 (GLint)pname,
8282 (GLint *)params
8283 );
Romain Guy84cac202016-12-05 12:26:02 -08008284
8285exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008286 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008287 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8288 }
8289 if (_exception) {
8290 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008291 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008292}
8293
8294/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
8295static void
8296android_glGetRenderbufferParameterivOES__II_3II
8297 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008298 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008299 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008300 "glGetRenderbufferParameterivOES");
8301 return;
8302 }
8303 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008304 const char * _exceptionType = NULL;
8305 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008306 GLint *params_base = (GLint *) 0;
8307 jint _remaining;
8308 GLint *params = (GLint *) 0;
8309
8310 if (!params_ref) {
8311 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008312 _exceptionType = "java/lang/IllegalArgumentException";
8313 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008314 goto exit;
8315 }
8316 if (offset < 0) {
8317 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008318 _exceptionType = "java/lang/IllegalArgumentException";
8319 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008320 goto exit;
8321 }
8322 _remaining = _env->GetArrayLength(params_ref) - offset;
8323 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008324 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008325 params = params_base + offset;
8326
8327 glGetRenderbufferParameterivOES(
8328 (GLint)target,
8329 (GLint)pname,
8330 (GLint *)params
8331 );
8332
8333exit:
8334 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008335 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008336 _exception ? JNI_ABORT: 0);
8337 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008338 if (_exception) {
8339 jniThrowException(_env, _exceptionType, _exceptionMessage);
8340 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008341}
8342
8343/* void glGetRenderbufferParameterivOES ( GLint target, GLint pname, GLint *params ) */
8344static void
8345android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2
8346 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008347 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008348 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008349 "glGetRenderbufferParameterivOES");
8350 return;
8351 }
Romain Guy84cac202016-12-05 12:26:02 -08008352 jint _exception = 0;
8353 const char * _exceptionType = NULL;
8354 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008355 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008356 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008357 jint _remaining;
8358 GLint *params = (GLint *) 0;
8359
Romain Guy84cac202016-12-05 12:26:02 -08008360 if (!params_buf) {
8361 _exception = 1;
8362 _exceptionType = "java/lang/IllegalArgumentException";
8363 _exceptionMessage = "params == null";
8364 goto exit;
8365 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008366 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008367 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008368 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008369 params = (GLint *) (_paramsBase + _bufferOffset);
8370 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008371 glGetRenderbufferParameterivOES(
8372 (GLint)target,
8373 (GLint)pname,
8374 (GLint *)params
8375 );
Romain Guy84cac202016-12-05 12:26:02 -08008376
8377exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008378 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008379 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8380 }
8381 if (_exception) {
8382 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008383 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008384}
8385
8386/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8387static void
8388android_glGetTexGenfv__II_3FI
8389 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008390 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008391 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008392 "glGetTexGenfv");
8393 return;
8394 }
8395 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008396 const char * _exceptionType = NULL;
8397 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008398 GLfloat *params_base = (GLfloat *) 0;
8399 jint _remaining;
8400 GLfloat *params = (GLfloat *) 0;
8401
8402 if (!params_ref) {
8403 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008404 _exceptionType = "java/lang/IllegalArgumentException";
8405 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008406 goto exit;
8407 }
8408 if (offset < 0) {
8409 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008410 _exceptionType = "java/lang/IllegalArgumentException";
8411 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008412 goto exit;
8413 }
8414 _remaining = _env->GetArrayLength(params_ref) - offset;
8415 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008416 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008417 params = params_base + offset;
8418
8419 glGetTexGenfv(
8420 (GLint)coord,
8421 (GLint)pname,
8422 (GLfloat *)params
8423 );
8424
8425exit:
8426 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008427 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008428 _exception ? JNI_ABORT: 0);
8429 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008430 if (_exception) {
8431 jniThrowException(_env, _exceptionType, _exceptionMessage);
8432 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008433}
8434
8435/* void glGetTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8436static void
8437android_glGetTexGenfv__IILjava_nio_FloatBuffer_2
8438 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008439 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008440 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008441 "glGetTexGenfv");
8442 return;
8443 }
Romain Guy84cac202016-12-05 12:26:02 -08008444 jint _exception = 0;
8445 const char * _exceptionType = NULL;
8446 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008447 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008448 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008449 jint _remaining;
8450 GLfloat *params = (GLfloat *) 0;
8451
Romain Guy84cac202016-12-05 12:26:02 -08008452 if (!params_buf) {
8453 _exception = 1;
8454 _exceptionType = "java/lang/IllegalArgumentException";
8455 _exceptionMessage = "params == null";
8456 goto exit;
8457 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008458 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008459 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008460 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008461 params = (GLfloat *) (_paramsBase + _bufferOffset);
8462 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008463 glGetTexGenfv(
8464 (GLint)coord,
8465 (GLint)pname,
8466 (GLfloat *)params
8467 );
Romain Guy84cac202016-12-05 12:26:02 -08008468
8469exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008470 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008471 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
8472 }
8473 if (_exception) {
8474 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008475 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008476}
8477
8478/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8479static void
8480android_glGetTexGeniv__II_3II
8481 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008482 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008483 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008484 "glGetTexGeniv");
8485 return;
8486 }
8487 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008488 const char * _exceptionType = NULL;
8489 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008490 GLint *params_base = (GLint *) 0;
8491 jint _remaining;
8492 GLint *params = (GLint *) 0;
8493
8494 if (!params_ref) {
8495 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008496 _exceptionType = "java/lang/IllegalArgumentException";
8497 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008498 goto exit;
8499 }
8500 if (offset < 0) {
8501 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008502 _exceptionType = "java/lang/IllegalArgumentException";
8503 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008504 goto exit;
8505 }
8506 _remaining = _env->GetArrayLength(params_ref) - offset;
8507 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008508 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008509 params = params_base + offset;
8510
8511 glGetTexGeniv(
8512 (GLint)coord,
8513 (GLint)pname,
8514 (GLint *)params
8515 );
8516
8517exit:
8518 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008519 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008520 _exception ? JNI_ABORT: 0);
8521 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008522 if (_exception) {
8523 jniThrowException(_env, _exceptionType, _exceptionMessage);
8524 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008525}
8526
8527/* void glGetTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8528static void
8529android_glGetTexGeniv__IILjava_nio_IntBuffer_2
8530 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008531 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008532 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008533 "glGetTexGeniv");
8534 return;
8535 }
Romain Guy84cac202016-12-05 12:26:02 -08008536 jint _exception = 0;
8537 const char * _exceptionType = NULL;
8538 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008539 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008540 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008541 jint _remaining;
8542 GLint *params = (GLint *) 0;
8543
Romain Guy84cac202016-12-05 12:26:02 -08008544 if (!params_buf) {
8545 _exception = 1;
8546 _exceptionType = "java/lang/IllegalArgumentException";
8547 _exceptionMessage = "params == null";
8548 goto exit;
8549 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008550 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008551 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008552 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008553 params = (GLint *) (_paramsBase + _bufferOffset);
8554 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008555 glGetTexGeniv(
8556 (GLint)coord,
8557 (GLint)pname,
8558 (GLint *)params
8559 );
Romain Guy84cac202016-12-05 12:26:02 -08008560
8561exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008562 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008563 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8564 }
8565 if (_exception) {
8566 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008567 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008568}
8569
8570/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8571static void
8572android_glGetTexGenxv__II_3II
8573 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008574 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008575 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008576 "glGetTexGenxv");
8577 return;
8578 }
8579 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008580 const char * _exceptionType = NULL;
8581 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008582 GLint *params_base = (GLint *) 0;
8583 jint _remaining;
8584 GLint *params = (GLint *) 0;
8585
8586 if (!params_ref) {
8587 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008588 _exceptionType = "java/lang/IllegalArgumentException";
8589 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008590 goto exit;
8591 }
8592 if (offset < 0) {
8593 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008594 _exceptionType = "java/lang/IllegalArgumentException";
8595 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008596 goto exit;
8597 }
8598 _remaining = _env->GetArrayLength(params_ref) - offset;
8599 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008600 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008601 params = params_base + offset;
8602
8603 glGetTexGenxv(
8604 (GLint)coord,
8605 (GLint)pname,
8606 (GLint *)params
8607 );
8608
8609exit:
8610 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008611 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008612 _exception ? JNI_ABORT: 0);
8613 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008614 if (_exception) {
8615 jniThrowException(_env, _exceptionType, _exceptionMessage);
8616 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008617}
8618
8619/* void glGetTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8620static void
8621android_glGetTexGenxv__IILjava_nio_IntBuffer_2
8622 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008623 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008624 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008625 "glGetTexGenxv");
8626 return;
8627 }
Romain Guy84cac202016-12-05 12:26:02 -08008628 jint _exception = 0;
8629 const char * _exceptionType = NULL;
8630 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008631 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008632 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008633 jint _remaining;
8634 GLint *params = (GLint *) 0;
8635
Romain Guy84cac202016-12-05 12:26:02 -08008636 if (!params_buf) {
8637 _exception = 1;
8638 _exceptionType = "java/lang/IllegalArgumentException";
8639 _exceptionMessage = "params == null";
8640 goto exit;
8641 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008642 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008643 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008644 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008645 params = (GLint *) (_paramsBase + _bufferOffset);
8646 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008647 glGetTexGenxv(
8648 (GLint)coord,
8649 (GLint)pname,
8650 (GLint *)params
8651 );
Romain Guy84cac202016-12-05 12:26:02 -08008652
8653exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008654 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008655 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8656 }
8657 if (_exception) {
8658 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008659 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008660}
8661
8662/* GLboolean glIsFramebufferOES ( GLint framebuffer ) */
8663static jboolean
8664android_glIsFramebufferOES__I
8665 (JNIEnv *_env, jobject _this, jint framebuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008666 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008667 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008668 "glIsFramebufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008669 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008670 }
8671 GLboolean _returnValue = JNI_FALSE;
8672 _returnValue = glIsFramebufferOES(
8673 (GLint)framebuffer
8674 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07008675 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008676}
8677
8678/* GLboolean glIsRenderbufferOES ( GLint renderbuffer ) */
8679static jboolean
8680android_glIsRenderbufferOES__I
8681 (JNIEnv *_env, jobject _this, jint renderbuffer) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008682 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008683 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008684 "glIsRenderbufferOES");
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008685 return JNI_FALSE;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008686 }
8687 GLboolean _returnValue = JNI_FALSE;
8688 _returnValue = glIsRenderbufferOES(
8689 (GLint)renderbuffer
8690 );
Elliott Hughes428d3fc2013-09-24 17:15:41 -07008691 return (jboolean)_returnValue;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008692}
8693
8694/* void glRenderbufferStorageOES ( GLint target, GLint internalformat, GLint width, GLint height ) */
8695static void
8696android_glRenderbufferStorageOES__IIII
8697 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008698 if (! supportsExtension(_env, _this, have_OES_framebuffer_objectID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008699 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008700 "glRenderbufferStorageOES");
8701 return;
8702 }
8703 glRenderbufferStorageOES(
8704 (GLint)target,
8705 (GLint)internalformat,
8706 (GLint)width,
8707 (GLint)height
8708 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008709}
8710
8711/* void glTexGenf ( GLint coord, GLint pname, GLfloat param ) */
8712static void
8713android_glTexGenf__IIF
8714 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloat param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008715 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008716 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008717 "glTexGenf");
8718 return;
8719 }
8720 glTexGenf(
8721 (GLint)coord,
8722 (GLint)pname,
8723 (GLfloat)param
8724 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008725}
8726
8727/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8728static void
8729android_glTexGenfv__II_3FI
8730 (JNIEnv *_env, jobject _this, jint coord, jint pname, jfloatArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008731 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008732 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008733 "glTexGenfv");
8734 return;
8735 }
8736 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008737 const char * _exceptionType = NULL;
8738 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008739 GLfloat *params_base = (GLfloat *) 0;
8740 jint _remaining;
8741 GLfloat *params = (GLfloat *) 0;
8742
8743 if (!params_ref) {
8744 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008745 _exceptionType = "java/lang/IllegalArgumentException";
8746 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008747 goto exit;
8748 }
8749 if (offset < 0) {
8750 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008751 _exceptionType = "java/lang/IllegalArgumentException";
8752 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008753 goto exit;
8754 }
8755 _remaining = _env->GetArrayLength(params_ref) - offset;
8756 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008757 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008758 params = params_base + offset;
8759
8760 glTexGenfv(
8761 (GLint)coord,
8762 (GLint)pname,
8763 (GLfloat *)params
8764 );
8765
8766exit:
8767 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008768 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008769 _exception ? JNI_ABORT: 0);
8770 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008771 if (_exception) {
8772 jniThrowException(_env, _exceptionType, _exceptionMessage);
8773 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008774}
8775
8776/* void glTexGenfv ( GLint coord, GLint pname, GLfloat *params ) */
8777static void
8778android_glTexGenfv__IILjava_nio_FloatBuffer_2
8779 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008780 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008781 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008782 "glTexGenfv");
8783 return;
8784 }
Romain Guy84cac202016-12-05 12:26:02 -08008785 jint _exception = 0;
8786 const char * _exceptionType = NULL;
8787 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008788 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008789 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008790 jint _remaining;
8791 GLfloat *params = (GLfloat *) 0;
8792
Romain Guy84cac202016-12-05 12:26:02 -08008793 if (!params_buf) {
8794 _exception = 1;
8795 _exceptionType = "java/lang/IllegalArgumentException";
8796 _exceptionMessage = "params == null";
8797 goto exit;
8798 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008799 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008800 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008801 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008802 params = (GLfloat *) (_paramsBase + _bufferOffset);
8803 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008804 glTexGenfv(
8805 (GLint)coord,
8806 (GLint)pname,
8807 (GLfloat *)params
8808 );
Romain Guy84cac202016-12-05 12:26:02 -08008809
8810exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008811 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008812 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0);
8813 }
8814 if (_exception) {
8815 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008816 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008817}
8818
8819/* void glTexGeni ( GLint coord, GLint pname, GLint param ) */
8820static void
8821android_glTexGeni__III
8822 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008823 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008824 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008825 "glTexGeni");
8826 return;
8827 }
8828 glTexGeni(
8829 (GLint)coord,
8830 (GLint)pname,
8831 (GLint)param
8832 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008833}
8834
8835/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8836static void
8837android_glTexGeniv__II_3II
8838 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008839 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008840 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008841 "glTexGeniv");
8842 return;
8843 }
8844 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008845 const char * _exceptionType = NULL;
8846 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008847 GLint *params_base = (GLint *) 0;
8848 jint _remaining;
8849 GLint *params = (GLint *) 0;
8850
8851 if (!params_ref) {
8852 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008853 _exceptionType = "java/lang/IllegalArgumentException";
8854 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008855 goto exit;
8856 }
8857 if (offset < 0) {
8858 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008859 _exceptionType = "java/lang/IllegalArgumentException";
8860 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008861 goto exit;
8862 }
8863 _remaining = _env->GetArrayLength(params_ref) - offset;
8864 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008865 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008866 params = params_base + offset;
8867
8868 glTexGeniv(
8869 (GLint)coord,
8870 (GLint)pname,
8871 (GLint *)params
8872 );
8873
8874exit:
8875 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008876 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008877 _exception ? JNI_ABORT: 0);
8878 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008879 if (_exception) {
8880 jniThrowException(_env, _exceptionType, _exceptionMessage);
8881 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008882}
8883
8884/* void glTexGeniv ( GLint coord, GLint pname, GLint *params ) */
8885static void
8886android_glTexGeniv__IILjava_nio_IntBuffer_2
8887 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008888 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008889 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008890 "glTexGeniv");
8891 return;
8892 }
Romain Guy84cac202016-12-05 12:26:02 -08008893 jint _exception = 0;
8894 const char * _exceptionType = NULL;
8895 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008896 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008897 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008898 jint _remaining;
8899 GLint *params = (GLint *) 0;
8900
Romain Guy84cac202016-12-05 12:26:02 -08008901 if (!params_buf) {
8902 _exception = 1;
8903 _exceptionType = "java/lang/IllegalArgumentException";
8904 _exceptionMessage = "params == null";
8905 goto exit;
8906 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008907 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008908 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008909 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07008910 params = (GLint *) (_paramsBase + _bufferOffset);
8911 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008912 glTexGeniv(
8913 (GLint)coord,
8914 (GLint)pname,
8915 (GLint *)params
8916 );
Romain Guy84cac202016-12-05 12:26:02 -08008917
8918exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008919 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08008920 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
8921 }
8922 if (_exception) {
8923 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008924 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008925}
8926
8927/* void glTexGenx ( GLint coord, GLint pname, GLint param ) */
8928static void
8929android_glTexGenx__III
8930 (JNIEnv *_env, jobject _this, jint coord, jint pname, jint param) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008931 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008932 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008933 "glTexGenx");
8934 return;
8935 }
8936 glTexGenx(
8937 (GLint)coord,
8938 (GLint)pname,
8939 (GLint)param
8940 );
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008941}
8942
8943/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8944static void
8945android_glTexGenxv__II_3II
8946 (JNIEnv *_env, jobject _this, jint coord, jint pname, jintArray params_ref, jint offset) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008947 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008948 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008949 "glTexGenxv");
8950 return;
8951 }
8952 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08008953 const char * _exceptionType = NULL;
8954 const char * _exceptionMessage = NULL;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008955 GLint *params_base = (GLint *) 0;
8956 jint _remaining;
8957 GLint *params = (GLint *) 0;
8958
8959 if (!params_ref) {
8960 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008961 _exceptionType = "java/lang/IllegalArgumentException";
8962 _exceptionMessage = "params == null";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008963 goto exit;
8964 }
8965 if (offset < 0) {
8966 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008967 _exceptionType = "java/lang/IllegalArgumentException";
8968 _exceptionMessage = "offset < 0";
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008969 goto exit;
8970 }
8971 _remaining = _env->GetArrayLength(params_ref) - offset;
8972 params_base = (GLint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008973 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008974 params = params_base + offset;
8975
8976 glTexGenxv(
8977 (GLint)coord,
8978 (GLint)pname,
8979 (GLint *)params
8980 );
8981
8982exit:
8983 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07008984 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008985 _exception ? JNI_ABORT: 0);
8986 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07008987 if (_exception) {
8988 jniThrowException(_env, _exceptionType, _exceptionMessage);
8989 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08008990}
8991
8992/* void glTexGenxv ( GLint coord, GLint pname, GLint *params ) */
8993static void
8994android_glTexGenxv__IILjava_nio_IntBuffer_2
8995 (JNIEnv *_env, jobject _this, jint coord, jint pname, jobject params_buf) {
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008996 if (! supportsExtension(_env, _this, have_OES_texture_cube_mapID)) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07008997 jniThrowException(_env, "java/lang/UnsupportedOperationException",
Jack Palevich8a4de4b2010-01-28 20:28:32 +08008998 "glTexGenxv");
8999 return;
9000 }
Romain Guy84cac202016-12-05 12:26:02 -08009001 jint _exception = 0;
9002 const char * _exceptionType = NULL;
9003 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009004 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07009005 jint _bufferOffset = (jint) 0;
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009006 jint _remaining;
9007 GLint *params = (GLint *) 0;
9008
Romain Guy84cac202016-12-05 12:26:02 -08009009 if (!params_buf) {
9010 _exception = 1;
9011 _exceptionType = "java/lang/IllegalArgumentException";
9012 _exceptionMessage = "params == null";
9013 goto exit;
9014 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009015 params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07009016 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07009017 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07009018 params = (GLint *) (_paramsBase + _bufferOffset);
9019 }
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009020 glTexGenxv(
9021 (GLint)coord,
9022 (GLint)pname,
9023 (GLint *)params
9024 );
Romain Guy84cac202016-12-05 12:26:02 -08009025
9026exit:
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009027 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08009028 _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0);
9029 }
9030 if (_exception) {
9031 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich8a4de4b2010-01-28 20:28:32 +08009032 }
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009033}
9034
9035static const char *classPathName = "com/google/android/gles_jni/GLImpl";
9036
Daniel Micay76f6a862015-09-19 17:31:01 -04009037static const JNINativeMethod methods[] = {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009038{"_nativeClassInit", "()V", (void*)nativeClassInit },
9039{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
9040{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
9041{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
9042{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
9043{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
9044{"glClear", "(I)V", (void *) android_glClear__I },
9045{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
9046{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
9047{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
9048{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
9049{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
9050{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
9051{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
9052{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
9053{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
9054{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
9055{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
9056{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
9057{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
9058{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
9059{"glCullFace", "(I)V", (void *) android_glCullFace__I },
9060{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
9061{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
9062{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
9063{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
9064{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
9065{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
9066{"glDisable", "(I)V", (void *) android_glDisable__I },
9067{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
9068{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
9069{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
9070{"glEnable", "(I)V", (void *) android_glEnable__I },
9071{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
9072{"glFinish", "()V", (void *) android_glFinish__ },
9073{"glFlush", "()V", (void *) android_glFlush__ },
9074{"glFogf", "(IF)V", (void *) android_glFogf__IF },
9075{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
9076{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
9077{"glFogx", "(II)V", (void *) android_glFogx__II },
9078{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
9079{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
9080{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
9081{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
9082{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
9083{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
9084{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
9085{"glGetError", "()I", (void *) android_glGetError__ },
9086{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
9087{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
9088{"_glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
9089{"glHint", "(II)V", (void *) android_glHint__II },
9090{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
9091{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
9092{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
9093{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
9094{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
9095{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
9096{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
9097{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
9098{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
9099{"glLightx", "(III)V", (void *) android_glLightx__III },
9100{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
9101{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
9102{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
9103{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
9104{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
9105{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
9106{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
9107{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
9108{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
9109{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
9110{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
9111{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
9112{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
9113{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
9114{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
9115{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
9116{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
9117{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
9118{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
9119{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
9120{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
9121{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
9122{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
9123{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
9124{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
9125{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
9126{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
9127{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
9128{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
9129{"glPointSize", "(F)V", (void *) android_glPointSize__F },
9130{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
9131{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
9132{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
9133{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
9134{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
9135{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
9136{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
9137{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
9138{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
9139{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
9140{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
9141{"glScalex", "(III)V", (void *) android_glScalex__III },
9142{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
9143{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
9144{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
9145{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
9146{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
9147{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
9148{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
9149{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
9150{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
9151{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
9152{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
9153{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
9154{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
9155{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
9156{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
9157{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
9158{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
9159{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
9160{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
9161{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
9162{"glQueryMatrixxOES", "([II[II)I", (void *) android_glQueryMatrixxOES___3II_3II },
9163{"glQueryMatrixxOES", "(Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)I", (void *) android_glQueryMatrixxOES__Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
9164{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
9165{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
9166{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 },
9167{"glClipPlanef", "(I[FI)V", (void *) android_glClipPlanef__I_3FI },
9168{"glClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glClipPlanef__ILjava_nio_FloatBuffer_2 },
9169{"glClipPlanex", "(I[II)V", (void *) android_glClipPlanex__I_3II },
9170{"glClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glClipPlanex__ILjava_nio_IntBuffer_2 },
9171{"glColor4ub", "(BBBB)V", (void *) android_glColor4ub__BBBB },
9172{"glColorPointer", "(IIII)V", (void *) android_glColorPointer__IIII },
9173{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II },
9174{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 },
9175{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII },
9176{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II },
9177{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 },
9178{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI },
9179{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 },
9180{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II },
9181{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 },
9182{"glGetClipPlanef", "(I[FI)V", (void *) android_glGetClipPlanef__I_3FI },
9183{"glGetClipPlanef", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetClipPlanef__ILjava_nio_FloatBuffer_2 },
9184{"glGetClipPlanex", "(I[II)V", (void *) android_glGetClipPlanex__I_3II },
9185{"glGetClipPlanex", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetClipPlanex__ILjava_nio_IntBuffer_2 },
9186{"glGetFixedv", "(I[II)V", (void *) android_glGetFixedv__I_3II },
9187{"glGetFixedv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetFixedv__ILjava_nio_IntBuffer_2 },
9188{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI },
9189{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 },
9190{"glGetLightfv", "(II[FI)V", (void *) android_glGetLightfv__II_3FI },
9191{"glGetLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetLightfv__IILjava_nio_FloatBuffer_2 },
9192{"glGetLightxv", "(II[II)V", (void *) android_glGetLightxv__II_3II },
9193{"glGetLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetLightxv__IILjava_nio_IntBuffer_2 },
9194{"glGetMaterialfv", "(II[FI)V", (void *) android_glGetMaterialfv__II_3FI },
9195{"glGetMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMaterialfv__IILjava_nio_FloatBuffer_2 },
9196{"glGetMaterialxv", "(II[II)V", (void *) android_glGetMaterialxv__II_3II },
9197{"glGetMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetMaterialxv__IILjava_nio_IntBuffer_2 },
9198{"glGetTexEnviv", "(II[II)V", (void *) android_glGetTexEnviv__II_3II },
9199{"glGetTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnviv__IILjava_nio_IntBuffer_2 },
9200{"glGetTexEnvxv", "(II[II)V", (void *) android_glGetTexEnvxv__II_3II },
9201{"glGetTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexEnvxv__IILjava_nio_IntBuffer_2 },
9202{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
9203{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
9204{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II },
9205{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 },
9206{"glGetTexParameterxv", "(II[II)V", (void *) android_glGetTexParameterxv__II_3II },
9207{"glGetTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterxv__IILjava_nio_IntBuffer_2 },
9208{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I },
9209{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I },
9210{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I },
9211{"glNormalPointer", "(III)V", (void *) android_glNormalPointer__III },
9212{"glPointParameterf", "(IF)V", (void *) android_glPointParameterf__IF },
9213{"glPointParameterfv", "(I[FI)V", (void *) android_glPointParameterfv__I_3FI },
9214{"glPointParameterfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glPointParameterfv__ILjava_nio_FloatBuffer_2 },
9215{"glPointParameterx", "(II)V", (void *) android_glPointParameterx__II },
9216{"glPointParameterxv", "(I[II)V", (void *) android_glPointParameterxv__I_3II },
9217{"glPointParameterxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glPointParameterxv__ILjava_nio_IntBuffer_2 },
Jack Palevichbe6eac82009-12-08 15:43:51 +08009218{"glPointSizePointerOESBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glPointSizePointerOESBounds__IILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009219{"glTexCoordPointer", "(IIII)V", (void *) android_glTexCoordPointer__IIII },
9220{"glTexEnvi", "(III)V", (void *) android_glTexEnvi__III },
9221{"glTexEnviv", "(II[II)V", (void *) android_glTexEnviv__II_3II },
9222{"glTexEnviv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnviv__IILjava_nio_IntBuffer_2 },
9223{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI },
9224{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 },
9225{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III },
9226{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II },
9227{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 },
9228{"glTexParameterxv", "(II[II)V", (void *) android_glTexParameterxv__II_3II },
9229{"glTexParameterxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterxv__IILjava_nio_IntBuffer_2 },
9230{"glVertexPointer", "(IIII)V", (void *) android_glVertexPointer__IIII },
9231{"glCurrentPaletteMatrixOES", "(I)V", (void *) android_glCurrentPaletteMatrixOES__I },
9232{"glDrawTexfOES", "(FFFFF)V", (void *) android_glDrawTexfOES__FFFFF },
9233{"glDrawTexfvOES", "([FI)V", (void *) android_glDrawTexfvOES___3FI },
9234{"glDrawTexfvOES", "(Ljava/nio/FloatBuffer;)V", (void *) android_glDrawTexfvOES__Ljava_nio_FloatBuffer_2 },
9235{"glDrawTexiOES", "(IIIII)V", (void *) android_glDrawTexiOES__IIIII },
9236{"glDrawTexivOES", "([II)V", (void *) android_glDrawTexivOES___3II },
9237{"glDrawTexivOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexivOES__Ljava_nio_IntBuffer_2 },
9238{"glDrawTexsOES", "(SSSSS)V", (void *) android_glDrawTexsOES__SSSSS },
9239{"glDrawTexsvOES", "([SI)V", (void *) android_glDrawTexsvOES___3SI },
9240{"glDrawTexsvOES", "(Ljava/nio/ShortBuffer;)V", (void *) android_glDrawTexsvOES__Ljava_nio_ShortBuffer_2 },
9241{"glDrawTexxOES", "(IIIII)V", (void *) android_glDrawTexxOES__IIIII },
9242{"glDrawTexxvOES", "([II)V", (void *) android_glDrawTexxvOES___3II },
9243{"glDrawTexxvOES", "(Ljava/nio/IntBuffer;)V", (void *) android_glDrawTexxvOES__Ljava_nio_IntBuffer_2 },
9244{"glLoadPaletteFromModelViewMatrixOES", "()V", (void *) android_glLoadPaletteFromModelViewMatrixOES__ },
Jack Palevichbe6eac82009-12-08 15:43:51 +08009245{"glMatrixIndexPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glMatrixIndexPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009246{"glMatrixIndexPointerOES", "(IIII)V", (void *) android_glMatrixIndexPointerOES__IIII },
Jack Palevichbe6eac82009-12-08 15:43:51 +08009247{"glWeightPointerOESBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glWeightPointerOESBounds__IIILjava_nio_Buffer_2I },
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08009248{"glWeightPointerOES", "(IIII)V", (void *) android_glWeightPointerOES__IIII },
9249{"glBindFramebufferOES", "(II)V", (void *) android_glBindFramebufferOES__II },
9250{"glBindRenderbufferOES", "(II)V", (void *) android_glBindRenderbufferOES__II },
9251{"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I },
9252{"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II },
9253{"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII },
9254{"glCheckFramebufferStatusOES", "(I)I", (void *) android_glCheckFramebufferStatusOES__I },
9255{"glDeleteFramebuffersOES", "(I[II)V", (void *) android_glDeleteFramebuffersOES__I_3II },
9256{"glDeleteFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffersOES__ILjava_nio_IntBuffer_2 },
9257{"glDeleteRenderbuffersOES", "(I[II)V", (void *) android_glDeleteRenderbuffersOES__I_3II },
9258{"glDeleteRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffersOES__ILjava_nio_IntBuffer_2 },
9259{"glFramebufferRenderbufferOES", "(IIII)V", (void *) android_glFramebufferRenderbufferOES__IIII },
9260{"glFramebufferTexture2DOES", "(IIIII)V", (void *) android_glFramebufferTexture2DOES__IIIII },
9261{"glGenerateMipmapOES", "(I)V", (void *) android_glGenerateMipmapOES__I },
9262{"glGenFramebuffersOES", "(I[II)V", (void *) android_glGenFramebuffersOES__I_3II },
9263{"glGenFramebuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffersOES__ILjava_nio_IntBuffer_2 },
9264{"glGenRenderbuffersOES", "(I[II)V", (void *) android_glGenRenderbuffersOES__I_3II },
9265{"glGenRenderbuffersOES", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffersOES__ILjava_nio_IntBuffer_2 },
9266{"glGetFramebufferAttachmentParameterivOES", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameterivOES__III_3II },
9267{"glGetFramebufferAttachmentParameterivOES", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameterivOES__IIILjava_nio_IntBuffer_2 },
9268{"glGetRenderbufferParameterivOES", "(II[II)V", (void *) android_glGetRenderbufferParameterivOES__II_3II },
9269{"glGetRenderbufferParameterivOES", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameterivOES__IILjava_nio_IntBuffer_2 },
9270{"glGetTexGenfv", "(II[FI)V", (void *) android_glGetTexGenfv__II_3FI },
9271{"glGetTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexGenfv__IILjava_nio_FloatBuffer_2 },
9272{"glGetTexGeniv", "(II[II)V", (void *) android_glGetTexGeniv__II_3II },
9273{"glGetTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGeniv__IILjava_nio_IntBuffer_2 },
9274{"glGetTexGenxv", "(II[II)V", (void *) android_glGetTexGenxv__II_3II },
9275{"glGetTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexGenxv__IILjava_nio_IntBuffer_2 },
9276{"glIsFramebufferOES", "(I)Z", (void *) android_glIsFramebufferOES__I },
9277{"glIsRenderbufferOES", "(I)Z", (void *) android_glIsRenderbufferOES__I },
9278{"glRenderbufferStorageOES", "(IIII)V", (void *) android_glRenderbufferStorageOES__IIII },
9279{"glTexGenf", "(IIF)V", (void *) android_glTexGenf__IIF },
9280{"glTexGenfv", "(II[FI)V", (void *) android_glTexGenfv__II_3FI },
9281{"glTexGenfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexGenfv__IILjava_nio_FloatBuffer_2 },
9282{"glTexGeni", "(III)V", (void *) android_glTexGeni__III },
9283{"glTexGeniv", "(II[II)V", (void *) android_glTexGeniv__II_3II },
9284{"glTexGeniv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGeniv__IILjava_nio_IntBuffer_2 },
9285{"glTexGenx", "(III)V", (void *) android_glTexGenx__III },
9286{"glTexGenxv", "(II[II)V", (void *) android_glTexGenxv__II_3II },
9287{"glTexGenxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexGenxv__IILjava_nio_IntBuffer_2 },
9288};
9289
9290int register_com_google_android_gles_jni_GLImpl(JNIEnv *_env)
9291{
9292 int err;
9293 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
9294 return err;
9295}