blob: ef25319b760087b6f79d9340ffa0c136c9c489ea [file] [log] [blame]
Jack Palevich560814f2009-11-19 16:34:55 +08001/*
2**
3** Copyright 2009, The Android Open Source Project
4**
5** 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
8**
9** http://www.apache.org/licenses/LICENSE-2.0
10**
11** 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
15** limitations under the License.
16*/
17
18// This source file is automatically generated
19
20#include <android_runtime/AndroidRuntime.h>
21#include <utils/misc.h>
22
23#include <assert.h>
24#include <GLES2/gl2.h>
25#include <GLES2/gl2ext.h>
26
27static int initialized = 0;
28
29static jclass nioAccessClass;
30static jclass bufferClass;
31static jclass OOMEClass;
32static jclass UOEClass;
33static jclass IAEClass;
34static jclass AIOOBEClass;
35static jmethodID getBasePointerID;
36static jmethodID getBaseArrayID;
37static jmethodID getBaseArrayOffsetID;
38static jfieldID positionID;
39static jfieldID limitID;
40static jfieldID elementSizeShiftID;
41
42/* Cache method IDs each time the class is loaded. */
43
44static void
45nativeClassInitBuffer(JNIEnv *_env)
46{
47 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
48 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
49
50 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
51 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
52
53 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
54 "getBasePointer", "(Ljava/nio/Buffer;)J");
55 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
56 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
57 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
58 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
59
60 positionID = _env->GetFieldID(bufferClass, "position", "I");
61 limitID = _env->GetFieldID(bufferClass, "limit", "I");
62 elementSizeShiftID =
63 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
64}
65
66
67static void
68nativeClassInit(JNIEnv *_env, jclass glImplClass)
69{
70 nativeClassInitBuffer(_env);
71
72 jclass IAEClassLocal =
73 _env->FindClass("java/lang/IllegalArgumentException");
74 jclass OOMEClassLocal =
75 _env->FindClass("java/lang/OutOfMemoryError");
76 jclass UOEClassLocal =
77 _env->FindClass("java/lang/UnsupportedOperationException");
78 jclass AIOOBEClassLocal =
79 _env->FindClass("java/lang/ArrayIndexOutOfBoundsException");
80
81 IAEClass = (jclass) _env->NewGlobalRef(IAEClassLocal);
82 OOMEClass = (jclass) _env->NewGlobalRef(OOMEClassLocal);
83 UOEClass = (jclass) _env->NewGlobalRef(UOEClassLocal);
84 AIOOBEClass = (jclass) _env->NewGlobalRef(AIOOBEClassLocal);
85}
86
87static void *
88getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining)
89{
90 jint position;
91 jint limit;
92 jint elementSizeShift;
93 jlong pointer;
94 jint offset;
95 void *data;
96
97 position = _env->GetIntField(buffer, positionID);
98 limit = _env->GetIntField(buffer, limitID);
99 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
100 *remaining = (limit - position) << elementSizeShift;
101 pointer = _env->CallStaticLongMethod(nioAccessClass,
102 getBasePointerID, buffer);
103 if (pointer != 0L) {
104 *array = NULL;
105 return (void *) (jint) pointer;
106 }
107
108 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
109 getBaseArrayID, buffer);
110 offset = _env->CallStaticIntMethod(nioAccessClass,
111 getBaseArrayOffsetID, buffer);
112 data = _env->GetPrimitiveArrayCritical(*array, (jboolean *) 0);
113
114 return (void *) ((char *) data + offset);
115}
116
117
118static void
119releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
120{
121 _env->ReleasePrimitiveArrayCritical(array, data,
122 commit ? 0 : JNI_ABORT);
123}
124
125static void *
126getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
127 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
128 if (buf) {
129 jint position = _env->GetIntField(buffer, positionID);
130 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
131 buf += position << elementSizeShift;
132 } else {
133 _env->ThrowNew(IAEClass, "Must use a native order direct Buffer");
134 }
135 return (void*) buf;
136}
137
138static int
139getNumCompressedTextureFormats() {
140 int numCompressedTextureFormats = 0;
141 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
142 return numCompressedTextureFormats;
143}
144
145static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
146 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
147 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
148}
149
150// --------------------------------------------------------------------------
151
152/* void glActiveTexture ( GLenum texture ) */
153static void
154android_glActiveTexture__I
155 (JNIEnv *_env, jobject _this, jint texture) {
156 glActiveTexture(
157 (GLenum)texture
158 );
159}
160
161/* void glAttachShader ( GLuint program, GLuint shader ) */
162static void
163android_glAttachShader__II
164 (JNIEnv *_env, jobject _this, jint program, jint shader) {
165 glAttachShader(
166 (GLuint)program,
167 (GLuint)shader
168 );
169}
170
171/* void glBindAttribLocation ( GLuint program, GLuint index, const char *name ) */
172static void
173android_glBindAttribLocation__IILjava_lang_String_2
174 (JNIEnv *_env, jobject _this, jint program, jint index, jstring name) {
175 const char* _nativename = 0;
176
177 if (!name) {
178 _env->ThrowNew(IAEClass, "name == null");
179 goto exit;
180 }
181 _nativename = _env->GetStringUTFChars(name, 0);
182
183 glBindAttribLocation(
184 (GLuint)program,
185 (GLuint)index,
186 (char *)_nativename
187 );
188
189exit:
190 if (_nativename) {
191 _env->ReleaseStringUTFChars(name, _nativename);
192 }
193
194}
195
196/* void glBindBuffer ( GLenum target, GLuint buffer ) */
197static void
198android_glBindBuffer__II
199 (JNIEnv *_env, jobject _this, jint target, jint buffer) {
200 glBindBuffer(
201 (GLenum)target,
202 (GLuint)buffer
203 );
204}
205
206/* void glBindFramebuffer ( GLenum target, GLuint framebuffer ) */
207static void
208android_glBindFramebuffer__II
209 (JNIEnv *_env, jobject _this, jint target, jint framebuffer) {
210 glBindFramebuffer(
211 (GLenum)target,
212 (GLuint)framebuffer
213 );
214}
215
216/* void glBindRenderbuffer ( GLenum target, GLuint renderbuffer ) */
217static void
218android_glBindRenderbuffer__II
219 (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) {
220 glBindRenderbuffer(
221 (GLenum)target,
222 (GLuint)renderbuffer
223 );
224}
225
226/* void glBindTexture ( GLenum target, GLuint texture ) */
227static void
228android_glBindTexture__II
229 (JNIEnv *_env, jobject _this, jint target, jint texture) {
230 glBindTexture(
231 (GLenum)target,
232 (GLuint)texture
233 );
234}
235
236/* void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
237static void
238android_glBlendColor__FFFF
239 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
240 glBlendColor(
241 (GLclampf)red,
242 (GLclampf)green,
243 (GLclampf)blue,
244 (GLclampf)alpha
245 );
246}
247
248/* void glBlendEquation ( GLenum mode ) */
249static void
250android_glBlendEquation__I
251 (JNIEnv *_env, jobject _this, jint mode) {
252 _env->ThrowNew(UOEClass,
253 "glBlendEquation");
254}
255
256/* void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha ) */
257static void
258android_glBlendEquationSeparate__II
259 (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) {
260 _env->ThrowNew(UOEClass,
261 "glBlendEquationSeparate");
262}
263
264/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
265static void
266android_glBlendFunc__II
267 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
268 glBlendFunc(
269 (GLenum)sfactor,
270 (GLenum)dfactor
271 );
272}
273
274/* void glBlendFuncSeparate ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */
275static void
276android_glBlendFuncSeparate__IIII
277 (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
278 _env->ThrowNew(UOEClass,
279 "glBlendFuncSeparate");
280}
281
282/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */
283static void
284android_glBufferData__IILjava_nio_Buffer_2I
285 (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) {
286 jarray _array = (jarray) 0;
287 jint _remaining;
288 GLvoid *data = (GLvoid *) 0;
289
290 if (data_buf) {
291 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
292 if (_remaining < size) {
293 _env->ThrowNew(IAEClass, "remaining() < size");
294 goto exit;
295 }
296 }
297 glBufferData(
298 (GLenum)target,
299 (GLsizeiptr)size,
300 (GLvoid *)data,
301 (GLenum)usage
302 );
303
304exit:
305 if (_array) {
306 releasePointer(_env, _array, data, JNI_FALSE);
307 }
308}
309
310/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */
311static void
312android_glBufferSubData__IIILjava_nio_Buffer_2
313 (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) {
314 jarray _array = (jarray) 0;
315 jint _remaining;
316 GLvoid *data = (GLvoid *) 0;
317
318 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
319 if (_remaining < size) {
320 _env->ThrowNew(IAEClass, "remaining() < size");
321 goto exit;
322 }
323 glBufferSubData(
324 (GLenum)target,
325 (GLintptr)offset,
326 (GLsizeiptr)size,
327 (GLvoid *)data
328 );
329
330exit:
331 if (_array) {
332 releasePointer(_env, _array, data, JNI_FALSE);
333 }
334}
335
336/* GLenum glCheckFramebufferStatus ( GLenum target ) */
337static jint
338android_glCheckFramebufferStatus__I
339 (JNIEnv *_env, jobject _this, jint target) {
340 GLenum _returnValue;
341 _returnValue = glCheckFramebufferStatus(
342 (GLenum)target
343 );
344 return _returnValue;
345}
346
347/* void glClear ( GLbitfield mask ) */
348static void
349android_glClear__I
350 (JNIEnv *_env, jobject _this, jint mask) {
351 glClear(
352 (GLbitfield)mask
353 );
354}
355
356/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
357static void
358android_glClearColor__FFFF
359 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
360 glClearColor(
361 (GLclampf)red,
362 (GLclampf)green,
363 (GLclampf)blue,
364 (GLclampf)alpha
365 );
366}
367
368/* void glClearDepthf ( GLclampf depth ) */
369static void
370android_glClearDepthf__F
371 (JNIEnv *_env, jobject _this, jfloat depth) {
372 glClearDepthf(
373 (GLclampf)depth
374 );
375}
376
377/* void glClearStencil ( GLint s ) */
378static void
379android_glClearStencil__I
380 (JNIEnv *_env, jobject _this, jint s) {
381 glClearStencil(
382 (GLint)s
383 );
384}
385
386/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
387static void
388android_glColorMask__ZZZZ
389 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
390 glColorMask(
391 (GLboolean)red,
392 (GLboolean)green,
393 (GLboolean)blue,
394 (GLboolean)alpha
395 );
396}
397
398/* void glCompileShader ( GLuint shader ) */
399static void
400android_glCompileShader__I
401 (JNIEnv *_env, jobject _this, jint shader) {
402 glCompileShader(
403 (GLuint)shader
404 );
405}
406
407/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
408static void
409android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
410 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
411 jarray _array = (jarray) 0;
412 jint _remaining;
413 GLvoid *data = (GLvoid *) 0;
414
415 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
416 glCompressedTexImage2D(
417 (GLenum)target,
418 (GLint)level,
419 (GLenum)internalformat,
420 (GLsizei)width,
421 (GLsizei)height,
422 (GLint)border,
423 (GLsizei)imageSize,
424 (GLvoid *)data
425 );
426 if (_array) {
427 releasePointer(_env, _array, data, JNI_FALSE);
428 }
429}
430
431/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
432static void
433android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
434 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
435 jarray _array = (jarray) 0;
436 jint _remaining;
437 GLvoid *data = (GLvoid *) 0;
438
439 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining);
440 glCompressedTexSubImage2D(
441 (GLenum)target,
442 (GLint)level,
443 (GLint)xoffset,
444 (GLint)yoffset,
445 (GLsizei)width,
446 (GLsizei)height,
447 (GLenum)format,
448 (GLsizei)imageSize,
449 (GLvoid *)data
450 );
451 if (_array) {
452 releasePointer(_env, _array, data, JNI_FALSE);
453 }
454}
455
456/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
457static void
458android_glCopyTexImage2D__IIIIIIII
459 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
460 glCopyTexImage2D(
461 (GLenum)target,
462 (GLint)level,
463 (GLenum)internalformat,
464 (GLint)x,
465 (GLint)y,
466 (GLsizei)width,
467 (GLsizei)height,
468 (GLint)border
469 );
470}
471
472/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
473static void
474android_glCopyTexSubImage2D__IIIIIIII
475 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
476 glCopyTexSubImage2D(
477 (GLenum)target,
478 (GLint)level,
479 (GLint)xoffset,
480 (GLint)yoffset,
481 (GLint)x,
482 (GLint)y,
483 (GLsizei)width,
484 (GLsizei)height
485 );
486}
487
488/* GLuint glCreateProgram ( void ) */
489static jint
490android_glCreateProgram__
491 (JNIEnv *_env, jobject _this) {
492 GLuint _returnValue;
493 _returnValue = glCreateProgram();
494 return _returnValue;
495}
496
497/* GLuint glCreateShader ( GLenum type ) */
498static jint
499android_glCreateShader__I
500 (JNIEnv *_env, jobject _this, jint type) {
501 GLuint _returnValue;
502 _returnValue = glCreateShader(
503 (GLenum)type
504 );
505 return _returnValue;
506}
507
508/* void glCullFace ( GLenum mode ) */
509static void
510android_glCullFace__I
511 (JNIEnv *_env, jobject _this, jint mode) {
512 glCullFace(
513 (GLenum)mode
514 );
515}
516
517/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
518static void
519android_glDeleteBuffers__I_3II
520 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
521 GLuint *buffers_base = (GLuint *) 0;
522 jint _remaining;
523 GLuint *buffers = (GLuint *) 0;
524
525 if (!buffers_ref) {
526 _env->ThrowNew(IAEClass, "buffers == null");
527 goto exit;
528 }
529 if (offset < 0) {
530 _env->ThrowNew(IAEClass, "offset < 0");
531 goto exit;
532 }
533 _remaining = _env->GetArrayLength(buffers_ref) - offset;
534 if (_remaining < n) {
535 _env->ThrowNew(IAEClass, "length - offset < n");
536 goto exit;
537 }
538 buffers_base = (GLuint *)
539 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0);
540 buffers = buffers_base + offset;
541
542 glDeleteBuffers(
543 (GLsizei)n,
544 (GLuint *)buffers
545 );
546
547exit:
548 if (buffers_base) {
549 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base,
550 JNI_ABORT);
551 }
552}
553
554/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */
555static void
556android_glDeleteBuffers__ILjava_nio_IntBuffer_2
557 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
558 jarray _array = (jarray) 0;
559 jint _remaining;
560 GLuint *buffers = (GLuint *) 0;
561
562 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
563 if (_remaining < n) {
564 _env->ThrowNew(IAEClass, "remaining() < n");
565 goto exit;
566 }
567 glDeleteBuffers(
568 (GLsizei)n,
569 (GLuint *)buffers
570 );
571
572exit:
573 if (_array) {
574 releasePointer(_env, _array, buffers, JNI_FALSE);
575 }
576}
577
578/* void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) */
579static void
580android_glDeleteFramebuffers__I_3II
581 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
582 GLuint *framebuffers_base = (GLuint *) 0;
583 jint _remaining;
584 GLuint *framebuffers = (GLuint *) 0;
585
586 if (!framebuffers_ref) {
587 _env->ThrowNew(IAEClass, "framebuffers == null");
588 goto exit;
589 }
590 if (offset < 0) {
591 _env->ThrowNew(IAEClass, "offset < 0");
592 goto exit;
593 }
594 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
595 framebuffers_base = (GLuint *)
596 _env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0);
597 framebuffers = framebuffers_base + offset;
598
599 glDeleteFramebuffers(
600 (GLsizei)n,
601 (GLuint *)framebuffers
602 );
603
604exit:
605 if (framebuffers_base) {
606 _env->ReleasePrimitiveArrayCritical(framebuffers_ref, framebuffers_base,
607 JNI_ABORT);
608 }
609}
610
611/* void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) */
612static void
613android_glDeleteFramebuffers__ILjava_nio_IntBuffer_2
614 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
615 jarray _array = (jarray) 0;
616 jint _remaining;
617 GLuint *framebuffers = (GLuint *) 0;
618
619 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining);
620 glDeleteFramebuffers(
621 (GLsizei)n,
622 (GLuint *)framebuffers
623 );
624 if (_array) {
625 releasePointer(_env, _array, framebuffers, JNI_FALSE);
626 }
627}
628
629/* void glDeleteProgram ( GLuint program ) */
630static void
631android_glDeleteProgram__I
632 (JNIEnv *_env, jobject _this, jint program) {
633 glDeleteProgram(
634 (GLuint)program
635 );
636}
637
638/* void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) */
639static void
640android_glDeleteRenderbuffers__I_3II
641 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
642 GLuint *renderbuffers_base = (GLuint *) 0;
643 jint _remaining;
644 GLuint *renderbuffers = (GLuint *) 0;
645
646 if (!renderbuffers_ref) {
647 _env->ThrowNew(IAEClass, "renderbuffers == null");
648 goto exit;
649 }
650 if (offset < 0) {
651 _env->ThrowNew(IAEClass, "offset < 0");
652 goto exit;
653 }
654 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
655 renderbuffers_base = (GLuint *)
656 _env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0);
657 renderbuffers = renderbuffers_base + offset;
658
659 glDeleteRenderbuffers(
660 (GLsizei)n,
661 (GLuint *)renderbuffers
662 );
663
664exit:
665 if (renderbuffers_base) {
666 _env->ReleasePrimitiveArrayCritical(renderbuffers_ref, renderbuffers_base,
667 JNI_ABORT);
668 }
669}
670
671/* void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) */
672static void
673android_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2
674 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
675 jarray _array = (jarray) 0;
676 jint _remaining;
677 GLuint *renderbuffers = (GLuint *) 0;
678
679 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining);
680 glDeleteRenderbuffers(
681 (GLsizei)n,
682 (GLuint *)renderbuffers
683 );
684 if (_array) {
685 releasePointer(_env, _array, renderbuffers, JNI_FALSE);
686 }
687}
688
689/* void glDeleteShader ( GLuint shader ) */
690static void
691android_glDeleteShader__I
692 (JNIEnv *_env, jobject _this, jint shader) {
693 glDeleteShader(
694 (GLuint)shader
695 );
696}
697
698/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
699static void
700android_glDeleteTextures__I_3II
701 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
702 GLuint *textures_base = (GLuint *) 0;
703 jint _remaining;
704 GLuint *textures = (GLuint *) 0;
705
706 if (!textures_ref) {
707 _env->ThrowNew(IAEClass, "textures == null");
708 goto exit;
709 }
710 if (offset < 0) {
711 _env->ThrowNew(IAEClass, "offset < 0");
712 goto exit;
713 }
714 _remaining = _env->GetArrayLength(textures_ref) - offset;
715 if (_remaining < n) {
716 _env->ThrowNew(IAEClass, "length - offset < n");
717 goto exit;
718 }
719 textures_base = (GLuint *)
720 _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
721 textures = textures_base + offset;
722
723 glDeleteTextures(
724 (GLsizei)n,
725 (GLuint *)textures
726 );
727
728exit:
729 if (textures_base) {
730 _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
731 JNI_ABORT);
732 }
733}
734
735/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
736static void
737android_glDeleteTextures__ILjava_nio_IntBuffer_2
738 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
739 jarray _array = (jarray) 0;
740 jint _remaining;
741 GLuint *textures = (GLuint *) 0;
742
743 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining);
744 if (_remaining < n) {
745 _env->ThrowNew(IAEClass, "remaining() < n");
746 goto exit;
747 }
748 glDeleteTextures(
749 (GLsizei)n,
750 (GLuint *)textures
751 );
752
753exit:
754 if (_array) {
755 releasePointer(_env, _array, textures, JNI_FALSE);
756 }
757}
758
759/* void glDepthFunc ( GLenum func ) */
760static void
761android_glDepthFunc__I
762 (JNIEnv *_env, jobject _this, jint func) {
763 glDepthFunc(
764 (GLenum)func
765 );
766}
767
768/* void glDepthMask ( GLboolean flag ) */
769static void
770android_glDepthMask__Z
771 (JNIEnv *_env, jobject _this, jboolean flag) {
772 glDepthMask(
773 (GLboolean)flag
774 );
775}
776
777/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
778static void
779android_glDepthRangef__FF
780 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
781 glDepthRangef(
782 (GLclampf)zNear,
783 (GLclampf)zFar
784 );
785}
786
787/* void glDetachShader ( GLuint program, GLuint shader ) */
788static void
789android_glDetachShader__II
790 (JNIEnv *_env, jobject _this, jint program, jint shader) {
791 glDetachShader(
792 (GLuint)program,
793 (GLuint)shader
794 );
795}
796
797/* void glDisable ( GLenum cap ) */
798static void
799android_glDisable__I
800 (JNIEnv *_env, jobject _this, jint cap) {
801 glDisable(
802 (GLenum)cap
803 );
804}
805
806/* void glDisableVertexAttribArray ( GLuint index ) */
807static void
808android_glDisableVertexAttribArray__I
809 (JNIEnv *_env, jobject _this, jint index) {
810 glDisableVertexAttribArray(
811 (GLuint)index
812 );
813}
814
815/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
816static void
817android_glDrawArrays__III
818 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
819 glDrawArrays(
820 (GLenum)mode,
821 (GLint)first,
822 (GLsizei)count
823 );
824}
825
Jack Palevich224107a2010-06-22 20:08:40 +0800826/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */
827static void
828android_glDrawElements__IIII
829 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) {
830 glDrawElements(
831 (GLenum)mode,
832 (GLsizei)count,
833 (GLenum)type,
834 (const GLvoid *)offset
835 );
836}
837
Jack Palevich560814f2009-11-19 16:34:55 +0800838/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
839static void
840android_glDrawElements__IIILjava_nio_Buffer_2
841 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
842 jarray _array = (jarray) 0;
843 jint _remaining;
844 GLvoid *indices = (GLvoid *) 0;
845
846 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining);
847 if (_remaining < count) {
848 _env->ThrowNew(AIOOBEClass, "remaining() < count");
849 goto exit;
850 }
851 glDrawElements(
852 (GLenum)mode,
853 (GLsizei)count,
854 (GLenum)type,
855 (GLvoid *)indices
856 );
857
858exit:
859 if (_array) {
860 releasePointer(_env, _array, indices, JNI_FALSE);
861 }
862}
863
864/* void glEnable ( GLenum cap ) */
865static void
866android_glEnable__I
867 (JNIEnv *_env, jobject _this, jint cap) {
868 glEnable(
869 (GLenum)cap
870 );
871}
872
873/* void glEnableVertexAttribArray ( GLuint index ) */
874static void
875android_glEnableVertexAttribArray__I
876 (JNIEnv *_env, jobject _this, jint index) {
877 glEnableVertexAttribArray(
878 (GLuint)index
879 );
880}
881
882/* void glFinish ( void ) */
883static void
884android_glFinish__
885 (JNIEnv *_env, jobject _this) {
886 glFinish();
887}
888
889/* void glFlush ( void ) */
890static void
891android_glFlush__
892 (JNIEnv *_env, jobject _this) {
893 glFlush();
894}
895
896/* void glFramebufferRenderbuffer ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) */
897static void
898android_glFramebufferRenderbuffer__IIII
899 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) {
900 glFramebufferRenderbuffer(
901 (GLenum)target,
902 (GLenum)attachment,
903 (GLenum)renderbuffertarget,
904 (GLuint)renderbuffer
905 );
906}
907
908/* void glFramebufferTexture2D ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) */
909static void
910android_glFramebufferTexture2D__IIIII
911 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) {
912 glFramebufferTexture2D(
913 (GLenum)target,
914 (GLenum)attachment,
915 (GLenum)textarget,
916 (GLuint)texture,
917 (GLint)level
918 );
919}
920
921/* void glFrontFace ( GLenum mode ) */
922static void
923android_glFrontFace__I
924 (JNIEnv *_env, jobject _this, jint mode) {
925 glFrontFace(
926 (GLenum)mode
927 );
928}
929
930/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
931static void
932android_glGenBuffers__I_3II
933 (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) {
934 jint _exception = 0;
935 GLuint *buffers_base = (GLuint *) 0;
936 jint _remaining;
937 GLuint *buffers = (GLuint *) 0;
938
939 if (!buffers_ref) {
940 _exception = 1;
941 _env->ThrowNew(IAEClass, "buffers == null");
942 goto exit;
943 }
944 if (offset < 0) {
945 _exception = 1;
946 _env->ThrowNew(IAEClass, "offset < 0");
947 goto exit;
948 }
949 _remaining = _env->GetArrayLength(buffers_ref) - offset;
950 if (_remaining < n) {
951 _exception = 1;
952 _env->ThrowNew(IAEClass, "length - offset < n");
953 goto exit;
954 }
955 buffers_base = (GLuint *)
956 _env->GetPrimitiveArrayCritical(buffers_ref, (jboolean *)0);
957 buffers = buffers_base + offset;
958
959 glGenBuffers(
960 (GLsizei)n,
961 (GLuint *)buffers
962 );
963
964exit:
965 if (buffers_base) {
966 _env->ReleasePrimitiveArrayCritical(buffers_ref, buffers_base,
967 _exception ? JNI_ABORT: 0);
968 }
969}
970
971/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */
972static void
973android_glGenBuffers__ILjava_nio_IntBuffer_2
974 (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) {
975 jint _exception = 0;
976 jarray _array = (jarray) 0;
977 jint _remaining;
978 GLuint *buffers = (GLuint *) 0;
979
980 buffers = (GLuint *)getPointer(_env, buffers_buf, &_array, &_remaining);
981 if (_remaining < n) {
982 _exception = 1;
983 _env->ThrowNew(IAEClass, "remaining() < n");
984 goto exit;
985 }
986 glGenBuffers(
987 (GLsizei)n,
988 (GLuint *)buffers
989 );
990
991exit:
992 if (_array) {
993 releasePointer(_env, _array, buffers, _exception ? JNI_FALSE : JNI_TRUE);
994 }
995}
996
997/* void glGenerateMipmap ( GLenum target ) */
998static void
999android_glGenerateMipmap__I
1000 (JNIEnv *_env, jobject _this, jint target) {
1001 glGenerateMipmap(
1002 (GLenum)target
1003 );
1004}
1005
1006/* void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) */
1007static void
1008android_glGenFramebuffers__I_3II
1009 (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) {
1010 jint _exception = 0;
1011 GLuint *framebuffers_base = (GLuint *) 0;
1012 jint _remaining;
1013 GLuint *framebuffers = (GLuint *) 0;
1014
1015 if (!framebuffers_ref) {
1016 _exception = 1;
1017 _env->ThrowNew(IAEClass, "framebuffers == null");
1018 goto exit;
1019 }
1020 if (offset < 0) {
1021 _exception = 1;
1022 _env->ThrowNew(IAEClass, "offset < 0");
1023 goto exit;
1024 }
1025 _remaining = _env->GetArrayLength(framebuffers_ref) - offset;
1026 framebuffers_base = (GLuint *)
1027 _env->GetPrimitiveArrayCritical(framebuffers_ref, (jboolean *)0);
1028 framebuffers = framebuffers_base + offset;
1029
1030 glGenFramebuffers(
1031 (GLsizei)n,
1032 (GLuint *)framebuffers
1033 );
1034
1035exit:
1036 if (framebuffers_base) {
1037 _env->ReleasePrimitiveArrayCritical(framebuffers_ref, framebuffers_base,
1038 _exception ? JNI_ABORT: 0);
1039 }
1040}
1041
1042/* void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) */
1043static void
1044android_glGenFramebuffers__ILjava_nio_IntBuffer_2
1045 (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) {
1046 jint _exception = 0;
1047 jarray _array = (jarray) 0;
1048 jint _remaining;
1049 GLuint *framebuffers = (GLuint *) 0;
1050
1051 framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, &_array, &_remaining);
1052 glGenFramebuffers(
1053 (GLsizei)n,
1054 (GLuint *)framebuffers
1055 );
1056 if (_array) {
1057 releasePointer(_env, _array, framebuffers, _exception ? JNI_FALSE : JNI_TRUE);
1058 }
1059}
1060
1061/* void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) */
1062static void
1063android_glGenRenderbuffers__I_3II
1064 (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) {
1065 jint _exception = 0;
1066 GLuint *renderbuffers_base = (GLuint *) 0;
1067 jint _remaining;
1068 GLuint *renderbuffers = (GLuint *) 0;
1069
1070 if (!renderbuffers_ref) {
1071 _exception = 1;
1072 _env->ThrowNew(IAEClass, "renderbuffers == null");
1073 goto exit;
1074 }
1075 if (offset < 0) {
1076 _exception = 1;
1077 _env->ThrowNew(IAEClass, "offset < 0");
1078 goto exit;
1079 }
1080 _remaining = _env->GetArrayLength(renderbuffers_ref) - offset;
1081 renderbuffers_base = (GLuint *)
1082 _env->GetPrimitiveArrayCritical(renderbuffers_ref, (jboolean *)0);
1083 renderbuffers = renderbuffers_base + offset;
1084
1085 glGenRenderbuffers(
1086 (GLsizei)n,
1087 (GLuint *)renderbuffers
1088 );
1089
1090exit:
1091 if (renderbuffers_base) {
1092 _env->ReleasePrimitiveArrayCritical(renderbuffers_ref, renderbuffers_base,
1093 _exception ? JNI_ABORT: 0);
1094 }
1095}
1096
1097/* void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) */
1098static void
1099android_glGenRenderbuffers__ILjava_nio_IntBuffer_2
1100 (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) {
1101 jint _exception = 0;
1102 jarray _array = (jarray) 0;
1103 jint _remaining;
1104 GLuint *renderbuffers = (GLuint *) 0;
1105
1106 renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, &_array, &_remaining);
1107 glGenRenderbuffers(
1108 (GLsizei)n,
1109 (GLuint *)renderbuffers
1110 );
1111 if (_array) {
1112 releasePointer(_env, _array, renderbuffers, _exception ? JNI_FALSE : JNI_TRUE);
1113 }
1114}
1115
1116/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1117static void
1118android_glGenTextures__I_3II
1119 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1120 jint _exception = 0;
1121 GLuint *textures_base = (GLuint *) 0;
1122 jint _remaining;
1123 GLuint *textures = (GLuint *) 0;
1124
1125 if (!textures_ref) {
1126 _exception = 1;
1127 _env->ThrowNew(IAEClass, "textures == null");
1128 goto exit;
1129 }
1130 if (offset < 0) {
1131 _exception = 1;
1132 _env->ThrowNew(IAEClass, "offset < 0");
1133 goto exit;
1134 }
1135 _remaining = _env->GetArrayLength(textures_ref) - offset;
1136 if (_remaining < n) {
1137 _exception = 1;
1138 _env->ThrowNew(IAEClass, "length - offset < n");
1139 goto exit;
1140 }
1141 textures_base = (GLuint *)
1142 _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
1143 textures = textures_base + offset;
1144
1145 glGenTextures(
1146 (GLsizei)n,
1147 (GLuint *)textures
1148 );
1149
1150exit:
1151 if (textures_base) {
1152 _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
1153 _exception ? JNI_ABORT: 0);
1154 }
1155}
1156
1157/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1158static void
1159android_glGenTextures__ILjava_nio_IntBuffer_2
1160 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1161 jint _exception = 0;
1162 jarray _array = (jarray) 0;
1163 jint _remaining;
1164 GLuint *textures = (GLuint *) 0;
1165
1166 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining);
1167 if (_remaining < n) {
1168 _exception = 1;
1169 _env->ThrowNew(IAEClass, "remaining() < n");
1170 goto exit;
1171 }
1172 glGenTextures(
1173 (GLsizei)n,
1174 (GLuint *)textures
1175 );
1176
1177exit:
1178 if (_array) {
1179 releasePointer(_env, _array, textures, _exception ? JNI_FALSE : JNI_TRUE);
1180 }
1181}
1182
1183/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */
1184static void
1185android_glGetActiveAttrib__III_3II_3II_3II_3BI
1186 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) {
1187 jint _exception = 0;
1188 GLsizei *length_base = (GLsizei *) 0;
1189 jint _lengthRemaining;
1190 GLsizei *length = (GLsizei *) 0;
1191 GLint *size_base = (GLint *) 0;
1192 jint _sizeRemaining;
1193 GLint *size = (GLint *) 0;
1194 GLenum *type_base = (GLenum *) 0;
1195 jint _typeRemaining;
1196 GLenum *type = (GLenum *) 0;
1197 char *name_base = (char *) 0;
1198 jint _nameRemaining;
1199 char *name = (char *) 0;
1200
1201 if (!length_ref) {
1202 _exception = 1;
1203 _env->ThrowNew(IAEClass, "length == null");
1204 goto exit;
1205 }
1206 if (lengthOffset < 0) {
1207 _exception = 1;
1208 _env->ThrowNew(IAEClass, "lengthOffset < 0");
1209 goto exit;
1210 }
1211 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
1212 length_base = (GLsizei *)
1213 _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0);
1214 length = length_base + lengthOffset;
1215
1216 if (!size_ref) {
1217 _exception = 1;
1218 _env->ThrowNew(IAEClass, "size == null");
1219 goto exit;
1220 }
1221 if (sizeOffset < 0) {
1222 _exception = 1;
1223 _env->ThrowNew(IAEClass, "sizeOffset < 0");
1224 goto exit;
1225 }
1226 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
1227 size_base = (GLint *)
1228 _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0);
1229 size = size_base + sizeOffset;
1230
1231 if (!type_ref) {
1232 _exception = 1;
1233 _env->ThrowNew(IAEClass, "type == null");
1234 goto exit;
1235 }
1236 if (typeOffset < 0) {
1237 _exception = 1;
1238 _env->ThrowNew(IAEClass, "typeOffset < 0");
1239 goto exit;
1240 }
1241 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
1242 type_base = (GLenum *)
1243 _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0);
1244 type = type_base + typeOffset;
1245
1246 if (!name_ref) {
1247 _exception = 1;
1248 _env->ThrowNew(IAEClass, "name == null");
1249 goto exit;
1250 }
1251 if (nameOffset < 0) {
1252 _exception = 1;
1253 _env->ThrowNew(IAEClass, "nameOffset < 0");
1254 goto exit;
1255 }
1256 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
1257 name_base = (char *)
1258 _env->GetPrimitiveArrayCritical(name_ref, (jboolean *)0);
1259 name = name_base + nameOffset;
1260
1261 glGetActiveAttrib(
1262 (GLuint)program,
1263 (GLuint)index,
1264 (GLsizei)bufsize,
1265 (GLsizei *)length,
1266 (GLint *)size,
1267 (GLenum *)type,
1268 (char *)name
1269 );
1270
1271exit:
1272 if (name_base) {
1273 _env->ReleasePrimitiveArrayCritical(name_ref, name_base,
1274 _exception ? JNI_ABORT: 0);
1275 }
1276 if (type_base) {
1277 _env->ReleasePrimitiveArrayCritical(type_ref, type_base,
1278 _exception ? JNI_ABORT: 0);
1279 }
1280 if (size_base) {
1281 _env->ReleasePrimitiveArrayCritical(size_ref, size_base,
1282 _exception ? JNI_ABORT: 0);
1283 }
1284 if (length_base) {
1285 _env->ReleasePrimitiveArrayCritical(length_ref, length_base,
1286 _exception ? JNI_ABORT: 0);
1287 }
1288}
1289
1290/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */
1291static void
1292android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
1293 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) {
1294 jint _exception = 0;
1295 jarray _lengthArray = (jarray) 0;
1296 jarray _sizeArray = (jarray) 0;
1297 jarray _typeArray = (jarray) 0;
1298 jint _lengthRemaining;
1299 GLsizei *length = (GLsizei *) 0;
1300 jint _sizeRemaining;
1301 GLint *size = (GLint *) 0;
1302 jint _typeRemaining;
1303 GLenum *type = (GLenum *) 0;
1304
1305 length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining);
1306 size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining);
1307 type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining);
1308 glGetActiveAttrib(
1309 (GLuint)program,
1310 (GLuint)index,
1311 (GLsizei)bufsize,
1312 (GLsizei *)length,
1313 (GLint *)size,
1314 (GLenum *)type,
1315 (char *)name
1316 );
1317 if (_lengthArray) {
1318 releasePointer(_env, _lengthArray, type, _exception ? JNI_FALSE : JNI_TRUE);
1319 }
1320 if (_sizeArray) {
1321 releasePointer(_env, _sizeArray, size, _exception ? JNI_FALSE : JNI_TRUE);
1322 }
1323 if (_typeArray) {
1324 releasePointer(_env, _typeArray, length, _exception ? JNI_FALSE : JNI_TRUE);
1325 }
1326}
1327
1328/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */
1329static void
1330android_glGetActiveUniform__III_3II_3II_3II_3BI
1331 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) {
1332 jint _exception = 0;
1333 GLsizei *length_base = (GLsizei *) 0;
1334 jint _lengthRemaining;
1335 GLsizei *length = (GLsizei *) 0;
1336 GLint *size_base = (GLint *) 0;
1337 jint _sizeRemaining;
1338 GLint *size = (GLint *) 0;
1339 GLenum *type_base = (GLenum *) 0;
1340 jint _typeRemaining;
1341 GLenum *type = (GLenum *) 0;
1342 char *name_base = (char *) 0;
1343 jint _nameRemaining;
1344 char *name = (char *) 0;
1345
1346 if (!length_ref) {
1347 _exception = 1;
1348 _env->ThrowNew(IAEClass, "length == null");
1349 goto exit;
1350 }
1351 if (lengthOffset < 0) {
1352 _exception = 1;
1353 _env->ThrowNew(IAEClass, "lengthOffset < 0");
1354 goto exit;
1355 }
1356 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
1357 length_base = (GLsizei *)
1358 _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0);
1359 length = length_base + lengthOffset;
1360
1361 if (!size_ref) {
1362 _exception = 1;
1363 _env->ThrowNew(IAEClass, "size == null");
1364 goto exit;
1365 }
1366 if (sizeOffset < 0) {
1367 _exception = 1;
1368 _env->ThrowNew(IAEClass, "sizeOffset < 0");
1369 goto exit;
1370 }
1371 _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
1372 size_base = (GLint *)
1373 _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0);
1374 size = size_base + sizeOffset;
1375
1376 if (!type_ref) {
1377 _exception = 1;
1378 _env->ThrowNew(IAEClass, "type == null");
1379 goto exit;
1380 }
1381 if (typeOffset < 0) {
1382 _exception = 1;
1383 _env->ThrowNew(IAEClass, "typeOffset < 0");
1384 goto exit;
1385 }
1386 _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
1387 type_base = (GLenum *)
1388 _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0);
1389 type = type_base + typeOffset;
1390
1391 if (!name_ref) {
1392 _exception = 1;
1393 _env->ThrowNew(IAEClass, "name == null");
1394 goto exit;
1395 }
1396 if (nameOffset < 0) {
1397 _exception = 1;
1398 _env->ThrowNew(IAEClass, "nameOffset < 0");
1399 goto exit;
1400 }
1401 _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
1402 name_base = (char *)
1403 _env->GetPrimitiveArrayCritical(name_ref, (jboolean *)0);
1404 name = name_base + nameOffset;
1405
1406 glGetActiveUniform(
1407 (GLuint)program,
1408 (GLuint)index,
1409 (GLsizei)bufsize,
1410 (GLsizei *)length,
1411 (GLint *)size,
1412 (GLenum *)type,
1413 (char *)name
1414 );
1415
1416exit:
1417 if (name_base) {
1418 _env->ReleasePrimitiveArrayCritical(name_ref, name_base,
1419 _exception ? JNI_ABORT: 0);
1420 }
1421 if (type_base) {
1422 _env->ReleasePrimitiveArrayCritical(type_ref, type_base,
1423 _exception ? JNI_ABORT: 0);
1424 }
1425 if (size_base) {
1426 _env->ReleasePrimitiveArrayCritical(size_ref, size_base,
1427 _exception ? JNI_ABORT: 0);
1428 }
1429 if (length_base) {
1430 _env->ReleasePrimitiveArrayCritical(length_ref, length_base,
1431 _exception ? JNI_ABORT: 0);
1432 }
1433}
1434
1435/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */
1436static void
1437android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
1438 (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) {
1439 jint _exception = 0;
1440 jarray _lengthArray = (jarray) 0;
1441 jarray _sizeArray = (jarray) 0;
1442 jarray _typeArray = (jarray) 0;
1443 jint _lengthRemaining;
1444 GLsizei *length = (GLsizei *) 0;
1445 jint _sizeRemaining;
1446 GLint *size = (GLint *) 0;
1447 jint _typeRemaining;
1448 GLenum *type = (GLenum *) 0;
1449
1450 length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining);
1451 size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining);
1452 type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining);
1453 glGetActiveUniform(
1454 (GLuint)program,
1455 (GLuint)index,
1456 (GLsizei)bufsize,
1457 (GLsizei *)length,
1458 (GLint *)size,
1459 (GLenum *)type,
1460 (char *)name
1461 );
1462 if (_lengthArray) {
1463 releasePointer(_env, _lengthArray, type, _exception ? JNI_FALSE : JNI_TRUE);
1464 }
1465 if (_sizeArray) {
1466 releasePointer(_env, _sizeArray, size, _exception ? JNI_FALSE : JNI_TRUE);
1467 }
1468 if (_typeArray) {
1469 releasePointer(_env, _typeArray, length, _exception ? JNI_FALSE : JNI_TRUE);
1470 }
1471}
1472
1473/* void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) */
1474static void
1475android_glGetAttachedShaders__II_3II_3II
1476 (JNIEnv *_env, jobject _this, jint program, jint maxcount, jintArray count_ref, jint countOffset, jintArray shaders_ref, jint shadersOffset) {
1477 jint _exception = 0;
1478 GLsizei *count_base = (GLsizei *) 0;
1479 jint _countRemaining;
1480 GLsizei *count = (GLsizei *) 0;
1481 GLuint *shaders_base = (GLuint *) 0;
1482 jint _shadersRemaining;
1483 GLuint *shaders = (GLuint *) 0;
1484
1485 if (!count_ref) {
1486 _exception = 1;
1487 _env->ThrowNew(IAEClass, "count == null");
1488 goto exit;
1489 }
1490 if (countOffset < 0) {
1491 _exception = 1;
1492 _env->ThrowNew(IAEClass, "countOffset < 0");
1493 goto exit;
1494 }
1495 _countRemaining = _env->GetArrayLength(count_ref) - countOffset;
1496 count_base = (GLsizei *)
1497 _env->GetPrimitiveArrayCritical(count_ref, (jboolean *)0);
1498 count = count_base + countOffset;
1499
1500 if (!shaders_ref) {
1501 _exception = 1;
1502 _env->ThrowNew(IAEClass, "shaders == null");
1503 goto exit;
1504 }
1505 if (shadersOffset < 0) {
1506 _exception = 1;
1507 _env->ThrowNew(IAEClass, "shadersOffset < 0");
1508 goto exit;
1509 }
1510 _shadersRemaining = _env->GetArrayLength(shaders_ref) - shadersOffset;
1511 shaders_base = (GLuint *)
1512 _env->GetPrimitiveArrayCritical(shaders_ref, (jboolean *)0);
1513 shaders = shaders_base + shadersOffset;
1514
1515 glGetAttachedShaders(
1516 (GLuint)program,
1517 (GLsizei)maxcount,
1518 (GLsizei *)count,
1519 (GLuint *)shaders
1520 );
1521
1522exit:
1523 if (shaders_base) {
1524 _env->ReleasePrimitiveArrayCritical(shaders_ref, shaders_base,
1525 _exception ? JNI_ABORT: 0);
1526 }
1527 if (count_base) {
1528 _env->ReleasePrimitiveArrayCritical(count_ref, count_base,
1529 _exception ? JNI_ABORT: 0);
1530 }
1531}
1532
1533/* void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) */
1534static void
1535android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
1536 (JNIEnv *_env, jobject _this, jint program, jint maxcount, jobject count_buf, jobject shaders_buf) {
1537 jint _exception = 0;
1538 jarray _countArray = (jarray) 0;
1539 jarray _shadersArray = (jarray) 0;
1540 jint _countRemaining;
1541 GLsizei *count = (GLsizei *) 0;
1542 jint _shadersRemaining;
1543 GLuint *shaders = (GLuint *) 0;
1544
1545 count = (GLsizei *)getPointer(_env, count_buf, &_countArray, &_countRemaining);
1546 shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining);
1547 glGetAttachedShaders(
1548 (GLuint)program,
1549 (GLsizei)maxcount,
1550 (GLsizei *)count,
1551 (GLuint *)shaders
1552 );
1553 if (_countArray) {
1554 releasePointer(_env, _countArray, shaders, _exception ? JNI_FALSE : JNI_TRUE);
1555 }
1556 if (_shadersArray) {
1557 releasePointer(_env, _shadersArray, count, _exception ? JNI_FALSE : JNI_TRUE);
1558 }
1559}
1560
1561/* int glGetAttribLocation ( GLuint program, const char *name ) */
1562static jint
1563android_glGetAttribLocation__ILjava_lang_String_2
1564 (JNIEnv *_env, jobject _this, jint program, jstring name) {
1565 int _returnValue = 0;
1566 const char* _nativename = 0;
1567
1568 if (!name) {
1569 _env->ThrowNew(IAEClass, "name == null");
1570 goto exit;
1571 }
1572 _nativename = _env->GetStringUTFChars(name, 0);
1573
1574 _returnValue = glGetAttribLocation(
1575 (GLuint)program,
1576 (char *)_nativename
1577 );
1578
1579exit:
1580 if (_nativename) {
1581 _env->ReleaseStringUTFChars(name, _nativename);
1582 }
1583
1584 return _returnValue;
1585}
1586
1587/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
1588static void
1589android_glGetBooleanv__I_3ZI
1590 (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) {
1591 jint _exception = 0;
1592 GLboolean *params_base = (GLboolean *) 0;
1593 jint _remaining;
1594 GLboolean *params = (GLboolean *) 0;
1595
1596 if (!params_ref) {
1597 _exception = 1;
1598 _env->ThrowNew(IAEClass, "params == null");
1599 goto exit;
1600 }
1601 if (offset < 0) {
1602 _exception = 1;
1603 _env->ThrowNew(IAEClass, "offset < 0");
1604 goto exit;
1605 }
1606 _remaining = _env->GetArrayLength(params_ref) - offset;
1607 params_base = (GLboolean *)
1608 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1609 params = params_base + offset;
1610
1611 glGetBooleanv(
1612 (GLenum)pname,
1613 (GLboolean *)params
1614 );
1615
1616exit:
1617 if (params_base) {
1618 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1619 _exception ? JNI_ABORT: 0);
1620 }
1621}
1622
1623/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */
1624static void
1625android_glGetBooleanv__ILjava_nio_IntBuffer_2
1626 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1627 jint _exception = 0;
1628 jarray _array = (jarray) 0;
1629 jint _remaining;
1630 GLboolean *params = (GLboolean *) 0;
1631
1632 params = (GLboolean *)getPointer(_env, params_buf, &_array, &_remaining);
1633 glGetBooleanv(
1634 (GLenum)pname,
1635 (GLboolean *)params
1636 );
1637 if (_array) {
1638 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1639 }
1640}
1641
1642/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
1643static void
1644android_glGetBufferParameteriv__II_3II
1645 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
1646 _env->ThrowNew(UOEClass,
1647 "glGetBufferParameteriv");
1648}
1649
1650/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
1651static void
1652android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2
1653 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
1654 _env->ThrowNew(UOEClass,
1655 "glGetBufferParameteriv");
1656}
1657
1658/* GLenum glGetError ( void ) */
1659static jint
1660android_glGetError__
1661 (JNIEnv *_env, jobject _this) {
1662 GLenum _returnValue;
1663 _returnValue = glGetError();
1664 return _returnValue;
1665}
1666
1667/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
1668static void
1669android_glGetFloatv__I_3FI
1670 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
1671 jint _exception = 0;
1672 GLfloat *params_base = (GLfloat *) 0;
1673 jint _remaining;
1674 GLfloat *params = (GLfloat *) 0;
1675
1676 if (!params_ref) {
1677 _exception = 1;
1678 _env->ThrowNew(IAEClass, "params == null");
1679 goto exit;
1680 }
1681 if (offset < 0) {
1682 _exception = 1;
1683 _env->ThrowNew(IAEClass, "offset < 0");
1684 goto exit;
1685 }
1686 _remaining = _env->GetArrayLength(params_ref) - offset;
1687 params_base = (GLfloat *)
1688 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1689 params = params_base + offset;
1690
1691 glGetFloatv(
1692 (GLenum)pname,
1693 (GLfloat *)params
1694 );
1695
1696exit:
1697 if (params_base) {
1698 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1699 _exception ? JNI_ABORT: 0);
1700 }
1701}
1702
1703/* void glGetFloatv ( GLenum pname, GLfloat *params ) */
1704static void
1705android_glGetFloatv__ILjava_nio_FloatBuffer_2
1706 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1707 jint _exception = 0;
1708 jarray _array = (jarray) 0;
1709 jint _remaining;
1710 GLfloat *params = (GLfloat *) 0;
1711
1712 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
1713 glGetFloatv(
1714 (GLenum)pname,
1715 (GLfloat *)params
1716 );
1717 if (_array) {
1718 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1719 }
1720}
1721
1722/* void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */
1723static void
1724android_glGetFramebufferAttachmentParameteriv__III_3II
1725 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) {
1726 jint _exception = 0;
1727 GLint *params_base = (GLint *) 0;
1728 jint _remaining;
1729 GLint *params = (GLint *) 0;
1730
1731 if (!params_ref) {
1732 _exception = 1;
1733 _env->ThrowNew(IAEClass, "params == null");
1734 goto exit;
1735 }
1736 if (offset < 0) {
1737 _exception = 1;
1738 _env->ThrowNew(IAEClass, "offset < 0");
1739 goto exit;
1740 }
1741 _remaining = _env->GetArrayLength(params_ref) - offset;
1742 params_base = (GLint *)
1743 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1744 params = params_base + offset;
1745
1746 glGetFramebufferAttachmentParameteriv(
1747 (GLenum)target,
1748 (GLenum)attachment,
1749 (GLenum)pname,
1750 (GLint *)params
1751 );
1752
1753exit:
1754 if (params_base) {
1755 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1756 _exception ? JNI_ABORT: 0);
1757 }
1758}
1759
1760/* void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */
1761static void
1762android_glGetFramebufferAttachmentParameteriv__IIILjava_nio_IntBuffer_2
1763 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) {
1764 jint _exception = 0;
1765 jarray _array = (jarray) 0;
1766 jint _remaining;
1767 GLint *params = (GLint *) 0;
1768
1769 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
1770 glGetFramebufferAttachmentParameteriv(
1771 (GLenum)target,
1772 (GLenum)attachment,
1773 (GLenum)pname,
1774 (GLint *)params
1775 );
1776 if (_array) {
1777 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
1778 }
1779}
1780
1781/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1782static void
1783android_glGetIntegerv__I_3II
1784 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1785 jint _exception = 0;
1786 GLint *params_base = (GLint *) 0;
1787 jint _remaining;
1788 GLint *params = (GLint *) 0;
1789
1790 if (!params_ref) {
1791 _exception = 1;
1792 _env->ThrowNew(IAEClass, "params == null");
1793 goto exit;
1794 }
1795 if (offset < 0) {
1796 _exception = 1;
1797 _env->ThrowNew(IAEClass, "offset < 0");
1798 goto exit;
1799 }
1800 _remaining = _env->GetArrayLength(params_ref) - offset;
1801 int _needed;
1802 switch (pname) {
1803#if defined(GL_ALPHA_BITS)
1804 case GL_ALPHA_BITS:
1805#endif // defined(GL_ALPHA_BITS)
1806#if defined(GL_ALPHA_TEST_FUNC)
1807 case GL_ALPHA_TEST_FUNC:
1808#endif // defined(GL_ALPHA_TEST_FUNC)
1809#if defined(GL_ALPHA_TEST_REF)
1810 case GL_ALPHA_TEST_REF:
1811#endif // defined(GL_ALPHA_TEST_REF)
1812#if defined(GL_BLEND_DST)
1813 case GL_BLEND_DST:
1814#endif // defined(GL_BLEND_DST)
1815#if defined(GL_BLUE_BITS)
1816 case GL_BLUE_BITS:
1817#endif // defined(GL_BLUE_BITS)
1818#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1819 case GL_COLOR_ARRAY_BUFFER_BINDING:
1820#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
1821#if defined(GL_COLOR_ARRAY_SIZE)
1822 case GL_COLOR_ARRAY_SIZE:
1823#endif // defined(GL_COLOR_ARRAY_SIZE)
1824#if defined(GL_COLOR_ARRAY_STRIDE)
1825 case GL_COLOR_ARRAY_STRIDE:
1826#endif // defined(GL_COLOR_ARRAY_STRIDE)
1827#if defined(GL_COLOR_ARRAY_TYPE)
1828 case GL_COLOR_ARRAY_TYPE:
1829#endif // defined(GL_COLOR_ARRAY_TYPE)
1830#if defined(GL_CULL_FACE)
1831 case GL_CULL_FACE:
1832#endif // defined(GL_CULL_FACE)
1833#if defined(GL_DEPTH_BITS)
1834 case GL_DEPTH_BITS:
1835#endif // defined(GL_DEPTH_BITS)
1836#if defined(GL_DEPTH_CLEAR_VALUE)
1837 case GL_DEPTH_CLEAR_VALUE:
1838#endif // defined(GL_DEPTH_CLEAR_VALUE)
1839#if defined(GL_DEPTH_FUNC)
1840 case GL_DEPTH_FUNC:
1841#endif // defined(GL_DEPTH_FUNC)
1842#if defined(GL_DEPTH_WRITEMASK)
1843 case GL_DEPTH_WRITEMASK:
1844#endif // defined(GL_DEPTH_WRITEMASK)
1845#if defined(GL_FOG_DENSITY)
1846 case GL_FOG_DENSITY:
1847#endif // defined(GL_FOG_DENSITY)
1848#if defined(GL_FOG_END)
1849 case GL_FOG_END:
1850#endif // defined(GL_FOG_END)
1851#if defined(GL_FOG_MODE)
1852 case GL_FOG_MODE:
1853#endif // defined(GL_FOG_MODE)
1854#if defined(GL_FOG_START)
1855 case GL_FOG_START:
1856#endif // defined(GL_FOG_START)
1857#if defined(GL_FRONT_FACE)
1858 case GL_FRONT_FACE:
1859#endif // defined(GL_FRONT_FACE)
1860#if defined(GL_GREEN_BITS)
1861 case GL_GREEN_BITS:
1862#endif // defined(GL_GREEN_BITS)
1863#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1864 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
1865#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
1866#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1867 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
1868#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
1869#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1870 case GL_LIGHT_MODEL_COLOR_CONTROL:
1871#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
1872#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1873 case GL_LIGHT_MODEL_LOCAL_VIEWER:
1874#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
1875#if defined(GL_LIGHT_MODEL_TWO_SIDE)
1876 case GL_LIGHT_MODEL_TWO_SIDE:
1877#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
1878#if defined(GL_LINE_SMOOTH_HINT)
1879 case GL_LINE_SMOOTH_HINT:
1880#endif // defined(GL_LINE_SMOOTH_HINT)
1881#if defined(GL_LINE_WIDTH)
1882 case GL_LINE_WIDTH:
1883#endif // defined(GL_LINE_WIDTH)
1884#if defined(GL_LOGIC_OP_MODE)
1885 case GL_LOGIC_OP_MODE:
1886#endif // defined(GL_LOGIC_OP_MODE)
1887#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1888 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
1889#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
1890#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1891 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
1892#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
1893#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1894 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
1895#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
1896#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1897 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
1898#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
1899#if defined(GL_MATRIX_MODE)
1900 case GL_MATRIX_MODE:
1901#endif // defined(GL_MATRIX_MODE)
1902#if defined(GL_MAX_CLIP_PLANES)
1903 case GL_MAX_CLIP_PLANES:
1904#endif // defined(GL_MAX_CLIP_PLANES)
1905#if defined(GL_MAX_ELEMENTS_INDICES)
1906 case GL_MAX_ELEMENTS_INDICES:
1907#endif // defined(GL_MAX_ELEMENTS_INDICES)
1908#if defined(GL_MAX_ELEMENTS_VERTICES)
1909 case GL_MAX_ELEMENTS_VERTICES:
1910#endif // defined(GL_MAX_ELEMENTS_VERTICES)
1911#if defined(GL_MAX_LIGHTS)
1912 case GL_MAX_LIGHTS:
1913#endif // defined(GL_MAX_LIGHTS)
1914#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1915 case GL_MAX_MODELVIEW_STACK_DEPTH:
1916#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
1917#if defined(GL_MAX_PALETTE_MATRICES_OES)
1918 case GL_MAX_PALETTE_MATRICES_OES:
1919#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
1920#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
1921 case GL_MAX_PROJECTION_STACK_DEPTH:
1922#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
1923#if defined(GL_MAX_TEXTURE_SIZE)
1924 case GL_MAX_TEXTURE_SIZE:
1925#endif // defined(GL_MAX_TEXTURE_SIZE)
1926#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
1927 case GL_MAX_TEXTURE_STACK_DEPTH:
1928#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
1929#if defined(GL_MAX_TEXTURE_UNITS)
1930 case GL_MAX_TEXTURE_UNITS:
1931#endif // defined(GL_MAX_TEXTURE_UNITS)
1932#if defined(GL_MAX_VERTEX_UNITS_OES)
1933 case GL_MAX_VERTEX_UNITS_OES:
1934#endif // defined(GL_MAX_VERTEX_UNITS_OES)
1935#if defined(GL_MODELVIEW_STACK_DEPTH)
1936 case GL_MODELVIEW_STACK_DEPTH:
1937#endif // defined(GL_MODELVIEW_STACK_DEPTH)
1938#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1939 case GL_NORMAL_ARRAY_BUFFER_BINDING:
1940#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
1941#if defined(GL_NORMAL_ARRAY_STRIDE)
1942 case GL_NORMAL_ARRAY_STRIDE:
1943#endif // defined(GL_NORMAL_ARRAY_STRIDE)
1944#if defined(GL_NORMAL_ARRAY_TYPE)
1945 case GL_NORMAL_ARRAY_TYPE:
1946#endif // defined(GL_NORMAL_ARRAY_TYPE)
1947#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1948 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
1949#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
1950#if defined(GL_PACK_ALIGNMENT)
1951 case GL_PACK_ALIGNMENT:
1952#endif // defined(GL_PACK_ALIGNMENT)
1953#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
1954 case GL_PERSPECTIVE_CORRECTION_HINT:
1955#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
1956#if defined(GL_POINT_SIZE)
1957 case GL_POINT_SIZE:
1958#endif // defined(GL_POINT_SIZE)
1959#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1960 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
1961#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
1962#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1963 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
1964#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
1965#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1966 case GL_POINT_SIZE_ARRAY_TYPE_OES:
1967#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
1968#if defined(GL_POINT_SMOOTH_HINT)
1969 case GL_POINT_SMOOTH_HINT:
1970#endif // defined(GL_POINT_SMOOTH_HINT)
1971#if defined(GL_POLYGON_OFFSET_FACTOR)
1972 case GL_POLYGON_OFFSET_FACTOR:
1973#endif // defined(GL_POLYGON_OFFSET_FACTOR)
1974#if defined(GL_POLYGON_OFFSET_UNITS)
1975 case GL_POLYGON_OFFSET_UNITS:
1976#endif // defined(GL_POLYGON_OFFSET_UNITS)
1977#if defined(GL_PROJECTION_STACK_DEPTH)
1978 case GL_PROJECTION_STACK_DEPTH:
1979#endif // defined(GL_PROJECTION_STACK_DEPTH)
1980#if defined(GL_RED_BITS)
1981 case GL_RED_BITS:
1982#endif // defined(GL_RED_BITS)
1983#if defined(GL_SHADE_MODEL)
1984 case GL_SHADE_MODEL:
1985#endif // defined(GL_SHADE_MODEL)
1986#if defined(GL_STENCIL_BITS)
1987 case GL_STENCIL_BITS:
1988#endif // defined(GL_STENCIL_BITS)
1989#if defined(GL_STENCIL_CLEAR_VALUE)
1990 case GL_STENCIL_CLEAR_VALUE:
1991#endif // defined(GL_STENCIL_CLEAR_VALUE)
1992#if defined(GL_STENCIL_FAIL)
1993 case GL_STENCIL_FAIL:
1994#endif // defined(GL_STENCIL_FAIL)
1995#if defined(GL_STENCIL_FUNC)
1996 case GL_STENCIL_FUNC:
1997#endif // defined(GL_STENCIL_FUNC)
1998#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
1999 case GL_STENCIL_PASS_DEPTH_FAIL:
2000#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
2001#if defined(GL_STENCIL_PASS_DEPTH_PASS)
2002 case GL_STENCIL_PASS_DEPTH_PASS:
2003#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
2004#if defined(GL_STENCIL_REF)
2005 case GL_STENCIL_REF:
2006#endif // defined(GL_STENCIL_REF)
2007#if defined(GL_STENCIL_VALUE_MASK)
2008 case GL_STENCIL_VALUE_MASK:
2009#endif // defined(GL_STENCIL_VALUE_MASK)
2010#if defined(GL_STENCIL_WRITEMASK)
2011 case GL_STENCIL_WRITEMASK:
2012#endif // defined(GL_STENCIL_WRITEMASK)
2013#if defined(GL_SUBPIXEL_BITS)
2014 case GL_SUBPIXEL_BITS:
2015#endif // defined(GL_SUBPIXEL_BITS)
2016#if defined(GL_TEXTURE_BINDING_2D)
2017 case GL_TEXTURE_BINDING_2D:
2018#endif // defined(GL_TEXTURE_BINDING_2D)
2019#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
2020 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
2021#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
2022#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
2023 case GL_TEXTURE_COORD_ARRAY_SIZE:
2024#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
2025#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
2026 case GL_TEXTURE_COORD_ARRAY_STRIDE:
2027#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
2028#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
2029 case GL_TEXTURE_COORD_ARRAY_TYPE:
2030#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
2031#if defined(GL_TEXTURE_STACK_DEPTH)
2032 case GL_TEXTURE_STACK_DEPTH:
2033#endif // defined(GL_TEXTURE_STACK_DEPTH)
2034#if defined(GL_UNPACK_ALIGNMENT)
2035 case GL_UNPACK_ALIGNMENT:
2036#endif // defined(GL_UNPACK_ALIGNMENT)
2037#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
2038 case GL_VERTEX_ARRAY_BUFFER_BINDING:
2039#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
2040#if defined(GL_VERTEX_ARRAY_SIZE)
2041 case GL_VERTEX_ARRAY_SIZE:
2042#endif // defined(GL_VERTEX_ARRAY_SIZE)
2043#if defined(GL_VERTEX_ARRAY_STRIDE)
2044 case GL_VERTEX_ARRAY_STRIDE:
2045#endif // defined(GL_VERTEX_ARRAY_STRIDE)
2046#if defined(GL_VERTEX_ARRAY_TYPE)
2047 case GL_VERTEX_ARRAY_TYPE:
2048#endif // defined(GL_VERTEX_ARRAY_TYPE)
2049#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
2050 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
2051#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
2052#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
2053 case GL_WEIGHT_ARRAY_SIZE_OES:
2054#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
2055#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
2056 case GL_WEIGHT_ARRAY_STRIDE_OES:
2057#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
2058#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
2059 case GL_WEIGHT_ARRAY_TYPE_OES:
2060#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
2061 _needed = 1;
2062 break;
2063#if defined(GL_ALIASED_POINT_SIZE_RANGE)
2064 case GL_ALIASED_POINT_SIZE_RANGE:
2065#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
2066#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
2067 case GL_ALIASED_LINE_WIDTH_RANGE:
2068#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
2069#if defined(GL_DEPTH_RANGE)
2070 case GL_DEPTH_RANGE:
2071#endif // defined(GL_DEPTH_RANGE)
2072#if defined(GL_MAX_VIEWPORT_DIMS)
2073 case GL_MAX_VIEWPORT_DIMS:
2074#endif // defined(GL_MAX_VIEWPORT_DIMS)
2075#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
2076 case GL_SMOOTH_LINE_WIDTH_RANGE:
2077#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
2078#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
2079 case GL_SMOOTH_POINT_SIZE_RANGE:
2080#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
2081 _needed = 2;
2082 break;
2083#if defined(GL_COLOR_CLEAR_VALUE)
2084 case GL_COLOR_CLEAR_VALUE:
2085#endif // defined(GL_COLOR_CLEAR_VALUE)
2086#if defined(GL_COLOR_WRITEMASK)
2087 case GL_COLOR_WRITEMASK:
2088#endif // defined(GL_COLOR_WRITEMASK)
2089#if defined(GL_FOG_COLOR)
2090 case GL_FOG_COLOR:
2091#endif // defined(GL_FOG_COLOR)
2092#if defined(GL_LIGHT_MODEL_AMBIENT)
2093 case GL_LIGHT_MODEL_AMBIENT:
2094#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2095#if defined(GL_SCISSOR_BOX)
2096 case GL_SCISSOR_BOX:
2097#endif // defined(GL_SCISSOR_BOX)
2098#if defined(GL_VIEWPORT)
2099 case GL_VIEWPORT:
2100#endif // defined(GL_VIEWPORT)
2101 _needed = 4;
2102 break;
2103#if defined(GL_MODELVIEW_MATRIX)
2104 case GL_MODELVIEW_MATRIX:
2105#endif // defined(GL_MODELVIEW_MATRIX)
2106#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
2107 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
2108#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
2109#if defined(GL_PROJECTION_MATRIX)
2110 case GL_PROJECTION_MATRIX:
2111#endif // defined(GL_PROJECTION_MATRIX)
2112#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
2113 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
2114#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
2115#if defined(GL_TEXTURE_MATRIX)
2116 case GL_TEXTURE_MATRIX:
2117#endif // defined(GL_TEXTURE_MATRIX)
2118#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
2119 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
2120#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
2121 _needed = 16;
2122 break;
2123#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
2124 case GL_COMPRESSED_TEXTURE_FORMATS:
2125#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
2126 _needed = getNumCompressedTextureFormats();
2127 break;
2128 default:
2129 _needed = 0;
2130 break;
2131 }
2132 if (_remaining < _needed) {
2133 _exception = 1;
2134 _env->ThrowNew(IAEClass, "length - offset < needed");
2135 goto exit;
2136 }
2137 params_base = (GLint *)
2138 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2139 params = params_base + offset;
2140
2141 glGetIntegerv(
2142 (GLenum)pname,
2143 (GLint *)params
2144 );
2145
2146exit:
2147 if (params_base) {
2148 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2149 _exception ? JNI_ABORT: 0);
2150 }
2151}
2152
2153/* void glGetIntegerv ( GLenum pname, GLint *params ) */
2154static void
2155android_glGetIntegerv__ILjava_nio_IntBuffer_2
2156 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
2157 jint _exception = 0;
2158 jarray _array = (jarray) 0;
2159 jint _remaining;
2160 GLint *params = (GLint *) 0;
2161
2162 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
2163 int _needed;
2164 switch (pname) {
2165#if defined(GL_ALPHA_BITS)
2166 case GL_ALPHA_BITS:
2167#endif // defined(GL_ALPHA_BITS)
2168#if defined(GL_ALPHA_TEST_FUNC)
2169 case GL_ALPHA_TEST_FUNC:
2170#endif // defined(GL_ALPHA_TEST_FUNC)
2171#if defined(GL_ALPHA_TEST_REF)
2172 case GL_ALPHA_TEST_REF:
2173#endif // defined(GL_ALPHA_TEST_REF)
2174#if defined(GL_BLEND_DST)
2175 case GL_BLEND_DST:
2176#endif // defined(GL_BLEND_DST)
2177#if defined(GL_BLUE_BITS)
2178 case GL_BLUE_BITS:
2179#endif // defined(GL_BLUE_BITS)
2180#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
2181 case GL_COLOR_ARRAY_BUFFER_BINDING:
2182#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
2183#if defined(GL_COLOR_ARRAY_SIZE)
2184 case GL_COLOR_ARRAY_SIZE:
2185#endif // defined(GL_COLOR_ARRAY_SIZE)
2186#if defined(GL_COLOR_ARRAY_STRIDE)
2187 case GL_COLOR_ARRAY_STRIDE:
2188#endif // defined(GL_COLOR_ARRAY_STRIDE)
2189#if defined(GL_COLOR_ARRAY_TYPE)
2190 case GL_COLOR_ARRAY_TYPE:
2191#endif // defined(GL_COLOR_ARRAY_TYPE)
2192#if defined(GL_CULL_FACE)
2193 case GL_CULL_FACE:
2194#endif // defined(GL_CULL_FACE)
2195#if defined(GL_DEPTH_BITS)
2196 case GL_DEPTH_BITS:
2197#endif // defined(GL_DEPTH_BITS)
2198#if defined(GL_DEPTH_CLEAR_VALUE)
2199 case GL_DEPTH_CLEAR_VALUE:
2200#endif // defined(GL_DEPTH_CLEAR_VALUE)
2201#if defined(GL_DEPTH_FUNC)
2202 case GL_DEPTH_FUNC:
2203#endif // defined(GL_DEPTH_FUNC)
2204#if defined(GL_DEPTH_WRITEMASK)
2205 case GL_DEPTH_WRITEMASK:
2206#endif // defined(GL_DEPTH_WRITEMASK)
2207#if defined(GL_FOG_DENSITY)
2208 case GL_FOG_DENSITY:
2209#endif // defined(GL_FOG_DENSITY)
2210#if defined(GL_FOG_END)
2211 case GL_FOG_END:
2212#endif // defined(GL_FOG_END)
2213#if defined(GL_FOG_MODE)
2214 case GL_FOG_MODE:
2215#endif // defined(GL_FOG_MODE)
2216#if defined(GL_FOG_START)
2217 case GL_FOG_START:
2218#endif // defined(GL_FOG_START)
2219#if defined(GL_FRONT_FACE)
2220 case GL_FRONT_FACE:
2221#endif // defined(GL_FRONT_FACE)
2222#if defined(GL_GREEN_BITS)
2223 case GL_GREEN_BITS:
2224#endif // defined(GL_GREEN_BITS)
2225#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
2226 case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
2227#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
2228#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
2229 case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
2230#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
2231#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
2232 case GL_LIGHT_MODEL_COLOR_CONTROL:
2233#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
2234#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
2235 case GL_LIGHT_MODEL_LOCAL_VIEWER:
2236#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
2237#if defined(GL_LIGHT_MODEL_TWO_SIDE)
2238 case GL_LIGHT_MODEL_TWO_SIDE:
2239#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
2240#if defined(GL_LINE_SMOOTH_HINT)
2241 case GL_LINE_SMOOTH_HINT:
2242#endif // defined(GL_LINE_SMOOTH_HINT)
2243#if defined(GL_LINE_WIDTH)
2244 case GL_LINE_WIDTH:
2245#endif // defined(GL_LINE_WIDTH)
2246#if defined(GL_LOGIC_OP_MODE)
2247 case GL_LOGIC_OP_MODE:
2248#endif // defined(GL_LOGIC_OP_MODE)
2249#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
2250 case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
2251#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
2252#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
2253 case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
2254#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
2255#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
2256 case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
2257#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
2258#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
2259 case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
2260#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
2261#if defined(GL_MATRIX_MODE)
2262 case GL_MATRIX_MODE:
2263#endif // defined(GL_MATRIX_MODE)
2264#if defined(GL_MAX_CLIP_PLANES)
2265 case GL_MAX_CLIP_PLANES:
2266#endif // defined(GL_MAX_CLIP_PLANES)
2267#if defined(GL_MAX_ELEMENTS_INDICES)
2268 case GL_MAX_ELEMENTS_INDICES:
2269#endif // defined(GL_MAX_ELEMENTS_INDICES)
2270#if defined(GL_MAX_ELEMENTS_VERTICES)
2271 case GL_MAX_ELEMENTS_VERTICES:
2272#endif // defined(GL_MAX_ELEMENTS_VERTICES)
2273#if defined(GL_MAX_LIGHTS)
2274 case GL_MAX_LIGHTS:
2275#endif // defined(GL_MAX_LIGHTS)
2276#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
2277 case GL_MAX_MODELVIEW_STACK_DEPTH:
2278#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
2279#if defined(GL_MAX_PALETTE_MATRICES_OES)
2280 case GL_MAX_PALETTE_MATRICES_OES:
2281#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
2282#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
2283 case GL_MAX_PROJECTION_STACK_DEPTH:
2284#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
2285#if defined(GL_MAX_TEXTURE_SIZE)
2286 case GL_MAX_TEXTURE_SIZE:
2287#endif // defined(GL_MAX_TEXTURE_SIZE)
2288#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
2289 case GL_MAX_TEXTURE_STACK_DEPTH:
2290#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
2291#if defined(GL_MAX_TEXTURE_UNITS)
2292 case GL_MAX_TEXTURE_UNITS:
2293#endif // defined(GL_MAX_TEXTURE_UNITS)
2294#if defined(GL_MAX_VERTEX_UNITS_OES)
2295 case GL_MAX_VERTEX_UNITS_OES:
2296#endif // defined(GL_MAX_VERTEX_UNITS_OES)
2297#if defined(GL_MODELVIEW_STACK_DEPTH)
2298 case GL_MODELVIEW_STACK_DEPTH:
2299#endif // defined(GL_MODELVIEW_STACK_DEPTH)
2300#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
2301 case GL_NORMAL_ARRAY_BUFFER_BINDING:
2302#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
2303#if defined(GL_NORMAL_ARRAY_STRIDE)
2304 case GL_NORMAL_ARRAY_STRIDE:
2305#endif // defined(GL_NORMAL_ARRAY_STRIDE)
2306#if defined(GL_NORMAL_ARRAY_TYPE)
2307 case GL_NORMAL_ARRAY_TYPE:
2308#endif // defined(GL_NORMAL_ARRAY_TYPE)
2309#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
2310 case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
2311#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
2312#if defined(GL_PACK_ALIGNMENT)
2313 case GL_PACK_ALIGNMENT:
2314#endif // defined(GL_PACK_ALIGNMENT)
2315#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
2316 case GL_PERSPECTIVE_CORRECTION_HINT:
2317#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
2318#if defined(GL_POINT_SIZE)
2319 case GL_POINT_SIZE:
2320#endif // defined(GL_POINT_SIZE)
2321#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
2322 case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
2323#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
2324#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
2325 case GL_POINT_SIZE_ARRAY_STRIDE_OES:
2326#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
2327#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
2328 case GL_POINT_SIZE_ARRAY_TYPE_OES:
2329#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
2330#if defined(GL_POINT_SMOOTH_HINT)
2331 case GL_POINT_SMOOTH_HINT:
2332#endif // defined(GL_POINT_SMOOTH_HINT)
2333#if defined(GL_POLYGON_OFFSET_FACTOR)
2334 case GL_POLYGON_OFFSET_FACTOR:
2335#endif // defined(GL_POLYGON_OFFSET_FACTOR)
2336#if defined(GL_POLYGON_OFFSET_UNITS)
2337 case GL_POLYGON_OFFSET_UNITS:
2338#endif // defined(GL_POLYGON_OFFSET_UNITS)
2339#if defined(GL_PROJECTION_STACK_DEPTH)
2340 case GL_PROJECTION_STACK_DEPTH:
2341#endif // defined(GL_PROJECTION_STACK_DEPTH)
2342#if defined(GL_RED_BITS)
2343 case GL_RED_BITS:
2344#endif // defined(GL_RED_BITS)
2345#if defined(GL_SHADE_MODEL)
2346 case GL_SHADE_MODEL:
2347#endif // defined(GL_SHADE_MODEL)
2348#if defined(GL_STENCIL_BITS)
2349 case GL_STENCIL_BITS:
2350#endif // defined(GL_STENCIL_BITS)
2351#if defined(GL_STENCIL_CLEAR_VALUE)
2352 case GL_STENCIL_CLEAR_VALUE:
2353#endif // defined(GL_STENCIL_CLEAR_VALUE)
2354#if defined(GL_STENCIL_FAIL)
2355 case GL_STENCIL_FAIL:
2356#endif // defined(GL_STENCIL_FAIL)
2357#if defined(GL_STENCIL_FUNC)
2358 case GL_STENCIL_FUNC:
2359#endif // defined(GL_STENCIL_FUNC)
2360#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
2361 case GL_STENCIL_PASS_DEPTH_FAIL:
2362#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
2363#if defined(GL_STENCIL_PASS_DEPTH_PASS)
2364 case GL_STENCIL_PASS_DEPTH_PASS:
2365#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
2366#if defined(GL_STENCIL_REF)
2367 case GL_STENCIL_REF:
2368#endif // defined(GL_STENCIL_REF)
2369#if defined(GL_STENCIL_VALUE_MASK)
2370 case GL_STENCIL_VALUE_MASK:
2371#endif // defined(GL_STENCIL_VALUE_MASK)
2372#if defined(GL_STENCIL_WRITEMASK)
2373 case GL_STENCIL_WRITEMASK:
2374#endif // defined(GL_STENCIL_WRITEMASK)
2375#if defined(GL_SUBPIXEL_BITS)
2376 case GL_SUBPIXEL_BITS:
2377#endif // defined(GL_SUBPIXEL_BITS)
2378#if defined(GL_TEXTURE_BINDING_2D)
2379 case GL_TEXTURE_BINDING_2D:
2380#endif // defined(GL_TEXTURE_BINDING_2D)
2381#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
2382 case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
2383#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
2384#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
2385 case GL_TEXTURE_COORD_ARRAY_SIZE:
2386#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
2387#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
2388 case GL_TEXTURE_COORD_ARRAY_STRIDE:
2389#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
2390#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
2391 case GL_TEXTURE_COORD_ARRAY_TYPE:
2392#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
2393#if defined(GL_TEXTURE_STACK_DEPTH)
2394 case GL_TEXTURE_STACK_DEPTH:
2395#endif // defined(GL_TEXTURE_STACK_DEPTH)
2396#if defined(GL_UNPACK_ALIGNMENT)
2397 case GL_UNPACK_ALIGNMENT:
2398#endif // defined(GL_UNPACK_ALIGNMENT)
2399#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
2400 case GL_VERTEX_ARRAY_BUFFER_BINDING:
2401#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
2402#if defined(GL_VERTEX_ARRAY_SIZE)
2403 case GL_VERTEX_ARRAY_SIZE:
2404#endif // defined(GL_VERTEX_ARRAY_SIZE)
2405#if defined(GL_VERTEX_ARRAY_STRIDE)
2406 case GL_VERTEX_ARRAY_STRIDE:
2407#endif // defined(GL_VERTEX_ARRAY_STRIDE)
2408#if defined(GL_VERTEX_ARRAY_TYPE)
2409 case GL_VERTEX_ARRAY_TYPE:
2410#endif // defined(GL_VERTEX_ARRAY_TYPE)
2411#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
2412 case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
2413#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
2414#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
2415 case GL_WEIGHT_ARRAY_SIZE_OES:
2416#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
2417#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
2418 case GL_WEIGHT_ARRAY_STRIDE_OES:
2419#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
2420#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
2421 case GL_WEIGHT_ARRAY_TYPE_OES:
2422#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
2423 _needed = 1;
2424 break;
2425#if defined(GL_ALIASED_POINT_SIZE_RANGE)
2426 case GL_ALIASED_POINT_SIZE_RANGE:
2427#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
2428#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
2429 case GL_ALIASED_LINE_WIDTH_RANGE:
2430#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
2431#if defined(GL_DEPTH_RANGE)
2432 case GL_DEPTH_RANGE:
2433#endif // defined(GL_DEPTH_RANGE)
2434#if defined(GL_MAX_VIEWPORT_DIMS)
2435 case GL_MAX_VIEWPORT_DIMS:
2436#endif // defined(GL_MAX_VIEWPORT_DIMS)
2437#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
2438 case GL_SMOOTH_LINE_WIDTH_RANGE:
2439#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
2440#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
2441 case GL_SMOOTH_POINT_SIZE_RANGE:
2442#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
2443 _needed = 2;
2444 break;
2445#if defined(GL_COLOR_CLEAR_VALUE)
2446 case GL_COLOR_CLEAR_VALUE:
2447#endif // defined(GL_COLOR_CLEAR_VALUE)
2448#if defined(GL_COLOR_WRITEMASK)
2449 case GL_COLOR_WRITEMASK:
2450#endif // defined(GL_COLOR_WRITEMASK)
2451#if defined(GL_FOG_COLOR)
2452 case GL_FOG_COLOR:
2453#endif // defined(GL_FOG_COLOR)
2454#if defined(GL_LIGHT_MODEL_AMBIENT)
2455 case GL_LIGHT_MODEL_AMBIENT:
2456#endif // defined(GL_LIGHT_MODEL_AMBIENT)
2457#if defined(GL_SCISSOR_BOX)
2458 case GL_SCISSOR_BOX:
2459#endif // defined(GL_SCISSOR_BOX)
2460#if defined(GL_VIEWPORT)
2461 case GL_VIEWPORT:
2462#endif // defined(GL_VIEWPORT)
2463 _needed = 4;
2464 break;
2465#if defined(GL_MODELVIEW_MATRIX)
2466 case GL_MODELVIEW_MATRIX:
2467#endif // defined(GL_MODELVIEW_MATRIX)
2468#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
2469 case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
2470#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
2471#if defined(GL_PROJECTION_MATRIX)
2472 case GL_PROJECTION_MATRIX:
2473#endif // defined(GL_PROJECTION_MATRIX)
2474#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
2475 case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
2476#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
2477#if defined(GL_TEXTURE_MATRIX)
2478 case GL_TEXTURE_MATRIX:
2479#endif // defined(GL_TEXTURE_MATRIX)
2480#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
2481 case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
2482#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
2483 _needed = 16;
2484 break;
2485#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
2486 case GL_COMPRESSED_TEXTURE_FORMATS:
2487#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
2488 _needed = getNumCompressedTextureFormats();
2489 break;
2490 default:
2491 _needed = 0;
2492 break;
2493 }
2494 if (_remaining < _needed) {
2495 _exception = 1;
2496 _env->ThrowNew(IAEClass, "remaining() < needed");
2497 goto exit;
2498 }
2499 glGetIntegerv(
2500 (GLenum)pname,
2501 (GLint *)params
2502 );
2503
2504exit:
2505 if (_array) {
2506 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
2507 }
2508}
2509
2510/* void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) */
2511static void
2512android_glGetProgramiv__II_3II
2513 (JNIEnv *_env, jobject _this, jint program, jint pname, jintArray params_ref, jint offset) {
2514 jint _exception = 0;
2515 GLint *params_base = (GLint *) 0;
2516 jint _remaining;
2517 GLint *params = (GLint *) 0;
2518
2519 if (!params_ref) {
2520 _exception = 1;
2521 _env->ThrowNew(IAEClass, "params == null");
2522 goto exit;
2523 }
2524 if (offset < 0) {
2525 _exception = 1;
2526 _env->ThrowNew(IAEClass, "offset < 0");
2527 goto exit;
2528 }
2529 _remaining = _env->GetArrayLength(params_ref) - offset;
2530 params_base = (GLint *)
2531 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2532 params = params_base + offset;
2533
2534 glGetProgramiv(
2535 (GLuint)program,
2536 (GLenum)pname,
2537 (GLint *)params
2538 );
2539
2540exit:
2541 if (params_base) {
2542 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2543 _exception ? JNI_ABORT: 0);
2544 }
2545}
2546
2547/* void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) */
2548static void
2549android_glGetProgramiv__IILjava_nio_IntBuffer_2
2550 (JNIEnv *_env, jobject _this, jint program, jint pname, jobject params_buf) {
2551 jint _exception = 0;
2552 jarray _array = (jarray) 0;
2553 jint _remaining;
2554 GLint *params = (GLint *) 0;
2555
2556 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
2557 glGetProgramiv(
2558 (GLuint)program,
2559 (GLenum)pname,
2560 (GLint *)params
2561 );
2562 if (_array) {
2563 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
2564 }
2565}
2566
2567#include <string.h>
2568
2569/* void glGetProgramInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */
2570static
2571jstring
2572android_glGetProgramInfoLog (JNIEnv *_env, jobject _this, jint shader) {
2573 GLint infoLen = 0;
2574 jstring _result = 0;
2575 char* buf = 0;
2576 glGetProgramiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
2577 if (infoLen) {
2578 char* buf = (char*) malloc(infoLen);
2579 if (buf == 0) {
2580 _env->ThrowNew(IAEClass, "out of memory");
2581 goto exit;
2582 }
2583 glGetProgramInfoLog(shader, infoLen, NULL, buf);
2584 _result = _env->NewStringUTF(buf);
2585 } else {
2586 _result = _env->NewStringUTF("");
2587 }
2588exit:
2589 if (buf) {
2590 free(buf);
2591 }
2592 return _result;
2593}
2594/* void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
2595static void
2596android_glGetRenderbufferParameteriv__II_3II
2597 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
2598 jint _exception = 0;
2599 GLint *params_base = (GLint *) 0;
2600 jint _remaining;
2601 GLint *params = (GLint *) 0;
2602
2603 if (!params_ref) {
2604 _exception = 1;
2605 _env->ThrowNew(IAEClass, "params == null");
2606 goto exit;
2607 }
2608 if (offset < 0) {
2609 _exception = 1;
2610 _env->ThrowNew(IAEClass, "offset < 0");
2611 goto exit;
2612 }
2613 _remaining = _env->GetArrayLength(params_ref) - offset;
2614 params_base = (GLint *)
2615 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2616 params = params_base + offset;
2617
2618 glGetRenderbufferParameteriv(
2619 (GLenum)target,
2620 (GLenum)pname,
2621 (GLint *)params
2622 );
2623
2624exit:
2625 if (params_base) {
2626 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2627 _exception ? JNI_ABORT: 0);
2628 }
2629}
2630
2631/* void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
2632static void
2633android_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2
2634 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2635 jint _exception = 0;
2636 jarray _array = (jarray) 0;
2637 jint _remaining;
2638 GLint *params = (GLint *) 0;
2639
2640 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
2641 glGetRenderbufferParameteriv(
2642 (GLenum)target,
2643 (GLenum)pname,
2644 (GLint *)params
2645 );
2646 if (_array) {
2647 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
2648 }
2649}
2650
2651/* void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) */
2652static void
2653android_glGetShaderiv__II_3II
2654 (JNIEnv *_env, jobject _this, jint shader, jint pname, jintArray params_ref, jint offset) {
2655 jint _exception = 0;
2656 GLint *params_base = (GLint *) 0;
2657 jint _remaining;
2658 GLint *params = (GLint *) 0;
2659
2660 if (!params_ref) {
2661 _exception = 1;
2662 _env->ThrowNew(IAEClass, "params == null");
2663 goto exit;
2664 }
2665 if (offset < 0) {
2666 _exception = 1;
2667 _env->ThrowNew(IAEClass, "offset < 0");
2668 goto exit;
2669 }
2670 _remaining = _env->GetArrayLength(params_ref) - offset;
2671 params_base = (GLint *)
2672 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2673 params = params_base + offset;
2674
2675 glGetShaderiv(
2676 (GLuint)shader,
2677 (GLenum)pname,
2678 (GLint *)params
2679 );
2680
2681exit:
2682 if (params_base) {
2683 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2684 _exception ? JNI_ABORT: 0);
2685 }
2686}
2687
2688/* void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) */
2689static void
2690android_glGetShaderiv__IILjava_nio_IntBuffer_2
2691 (JNIEnv *_env, jobject _this, jint shader, jint pname, jobject params_buf) {
2692 jint _exception = 0;
2693 jarray _array = (jarray) 0;
2694 jint _remaining;
2695 GLint *params = (GLint *) 0;
2696
2697 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
2698 glGetShaderiv(
2699 (GLuint)shader,
2700 (GLenum)pname,
2701 (GLint *)params
2702 );
2703 if (_array) {
2704 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
2705 }
2706}
2707
2708#include <string.h>
2709
2710/* void glGetShaderInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */
2711static
2712jstring
2713android_glGetShaderInfoLog (JNIEnv *_env, jobject _this, jint shader) {
2714 GLint infoLen = 0;
2715 jstring _result = 0;
2716 char* buf = 0;
2717 glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
2718 if (infoLen) {
2719 char* buf = (char*) malloc(infoLen);
2720 if (buf == 0) {
2721 _env->ThrowNew(IAEClass, "out of memory");
2722 goto exit;
2723 }
2724 glGetShaderInfoLog(shader, infoLen, NULL, buf);
2725 _result = _env->NewStringUTF(buf);
2726 } else {
2727 _result = _env->NewStringUTF("");
2728 }
2729exit:
2730 if (buf) {
2731 free(buf);
2732 }
2733 return _result;
2734}
2735/* void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) */
2736static void
2737android_glGetShaderPrecisionFormat__II_3II_3II
2738 (JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jintArray range_ref, jint rangeOffset, jintArray precision_ref, jint precisionOffset) {
2739 jint _exception = 0;
2740 GLint *range_base = (GLint *) 0;
2741 jint _rangeRemaining;
2742 GLint *range = (GLint *) 0;
2743 GLint *precision_base = (GLint *) 0;
2744 jint _precisionRemaining;
2745 GLint *precision = (GLint *) 0;
2746
2747 if (!range_ref) {
2748 _exception = 1;
2749 _env->ThrowNew(IAEClass, "range == null");
2750 goto exit;
2751 }
2752 if (rangeOffset < 0) {
2753 _exception = 1;
2754 _env->ThrowNew(IAEClass, "rangeOffset < 0");
2755 goto exit;
2756 }
2757 _rangeRemaining = _env->GetArrayLength(range_ref) - rangeOffset;
2758 range_base = (GLint *)
2759 _env->GetPrimitiveArrayCritical(range_ref, (jboolean *)0);
2760 range = range_base + rangeOffset;
2761
2762 if (!precision_ref) {
2763 _exception = 1;
2764 _env->ThrowNew(IAEClass, "precision == null");
2765 goto exit;
2766 }
2767 if (precisionOffset < 0) {
2768 _exception = 1;
2769 _env->ThrowNew(IAEClass, "precisionOffset < 0");
2770 goto exit;
2771 }
2772 _precisionRemaining = _env->GetArrayLength(precision_ref) - precisionOffset;
2773 precision_base = (GLint *)
2774 _env->GetPrimitiveArrayCritical(precision_ref, (jboolean *)0);
2775 precision = precision_base + precisionOffset;
2776
2777 glGetShaderPrecisionFormat(
2778 (GLenum)shadertype,
2779 (GLenum)precisiontype,
2780 (GLint *)range,
2781 (GLint *)precision
2782 );
2783
2784exit:
2785 if (precision_base) {
2786 _env->ReleasePrimitiveArrayCritical(precision_ref, precision_base,
2787 _exception ? JNI_ABORT: 0);
2788 }
2789 if (range_base) {
2790 _env->ReleasePrimitiveArrayCritical(range_ref, range_base,
2791 _exception ? JNI_ABORT: 0);
2792 }
2793}
2794
2795/* void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) */
2796static void
2797android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
2798 (JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jobject range_buf, jobject precision_buf) {
2799 jint _exception = 0;
2800 jarray _rangeArray = (jarray) 0;
2801 jarray _precisionArray = (jarray) 0;
2802 jint _rangeRemaining;
2803 GLint *range = (GLint *) 0;
2804 jint _precisionRemaining;
2805 GLint *precision = (GLint *) 0;
2806
2807 range = (GLint *)getPointer(_env, range_buf, &_rangeArray, &_rangeRemaining);
2808 precision = (GLint *)getPointer(_env, precision_buf, &_precisionArray, &_precisionRemaining);
2809 glGetShaderPrecisionFormat(
2810 (GLenum)shadertype,
2811 (GLenum)precisiontype,
2812 (GLint *)range,
2813 (GLint *)precision
2814 );
2815 if (_rangeArray) {
2816 releasePointer(_env, _rangeArray, precision, _exception ? JNI_FALSE : JNI_TRUE);
2817 }
2818 if (_precisionArray) {
2819 releasePointer(_env, _precisionArray, range, _exception ? JNI_FALSE : JNI_TRUE);
2820 }
2821}
2822
2823/* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */
2824static void
2825android_glGetShaderSource__II_3II_3BI
2826 (JNIEnv *_env, jobject _this, jint shader, jint bufsize, jintArray length_ref, jint lengthOffset, jbyteArray source_ref, jint sourceOffset) {
2827 jint _exception = 0;
2828 GLsizei *length_base = (GLsizei *) 0;
2829 jint _lengthRemaining;
2830 GLsizei *length = (GLsizei *) 0;
2831 char *source_base = (char *) 0;
2832 jint _sourceRemaining;
2833 char *source = (char *) 0;
2834
2835 if (!length_ref) {
2836 _exception = 1;
2837 _env->ThrowNew(IAEClass, "length == null");
2838 goto exit;
2839 }
2840 if (lengthOffset < 0) {
2841 _exception = 1;
2842 _env->ThrowNew(IAEClass, "lengthOffset < 0");
2843 goto exit;
2844 }
2845 _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
2846 length_base = (GLsizei *)
2847 _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0);
2848 length = length_base + lengthOffset;
2849
2850 if (!source_ref) {
2851 _exception = 1;
2852 _env->ThrowNew(IAEClass, "source == null");
2853 goto exit;
2854 }
2855 if (sourceOffset < 0) {
2856 _exception = 1;
2857 _env->ThrowNew(IAEClass, "sourceOffset < 0");
2858 goto exit;
2859 }
2860 _sourceRemaining = _env->GetArrayLength(source_ref) - sourceOffset;
2861 source_base = (char *)
2862 _env->GetPrimitiveArrayCritical(source_ref, (jboolean *)0);
2863 source = source_base + sourceOffset;
2864
2865 glGetShaderSource(
2866 (GLuint)shader,
2867 (GLsizei)bufsize,
2868 (GLsizei *)length,
2869 (char *)source
2870 );
2871
2872exit:
2873 if (source_base) {
2874 _env->ReleasePrimitiveArrayCritical(source_ref, source_base,
2875 _exception ? JNI_ABORT: 0);
2876 }
2877 if (length_base) {
2878 _env->ReleasePrimitiveArrayCritical(length_ref, length_base,
2879 _exception ? JNI_ABORT: 0);
2880 }
2881}
2882
2883/* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */
2884static void
2885android_glGetShaderSource__IILjava_nio_IntBuffer_2B
2886 (JNIEnv *_env, jobject _this, jint shader, jint bufsize, jobject length_buf, jbyte source) {
2887 jint _exception = 0;
2888 jarray _array = (jarray) 0;
2889 jint _remaining;
2890 GLsizei *length = (GLsizei *) 0;
2891
2892 length = (GLsizei *)getPointer(_env, length_buf, &_array, &_remaining);
2893 glGetShaderSource(
2894 (GLuint)shader,
2895 (GLsizei)bufsize,
2896 (GLsizei *)length,
2897 (char *)source
2898 );
2899 if (_array) {
2900 releasePointer(_env, _array, length, _exception ? JNI_FALSE : JNI_TRUE);
2901 }
2902}
2903
2904#include <string.h>
2905
2906/* const GLubyte * glGetString ( GLenum name ) */
2907static
2908jstring
2909android_glGetString
2910 (JNIEnv *_env, jobject _this, jint name) {
2911 const char * chars = (const char *)glGetString((GLenum)name);
2912 jstring output = _env->NewStringUTF(chars);
2913 return output;
2914}
2915/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
2916static void
2917android_glGetTexParameterfv__II_3FI
2918 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
2919 jint _exception = 0;
2920 GLfloat *params_base = (GLfloat *) 0;
2921 jint _remaining;
2922 GLfloat *params = (GLfloat *) 0;
2923
2924 if (!params_ref) {
2925 _exception = 1;
2926 _env->ThrowNew(IAEClass, "params == null");
2927 goto exit;
2928 }
2929 if (offset < 0) {
2930 _exception = 1;
2931 _env->ThrowNew(IAEClass, "offset < 0");
2932 goto exit;
2933 }
2934 _remaining = _env->GetArrayLength(params_ref) - offset;
2935 if (_remaining < 1) {
2936 _exception = 1;
2937 _env->ThrowNew(IAEClass, "length - offset < 1");
2938 goto exit;
2939 }
2940 params_base = (GLfloat *)
2941 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2942 params = params_base + offset;
2943
2944 glGetTexParameterfv(
2945 (GLenum)target,
2946 (GLenum)pname,
2947 (GLfloat *)params
2948 );
2949
2950exit:
2951 if (params_base) {
2952 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2953 _exception ? JNI_ABORT: 0);
2954 }
2955}
2956
2957/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */
2958static void
2959android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2
2960 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
2961 jint _exception = 0;
2962 jarray _array = (jarray) 0;
2963 jint _remaining;
2964 GLfloat *params = (GLfloat *) 0;
2965
2966 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
2967 if (_remaining < 1) {
2968 _exception = 1;
2969 _env->ThrowNew(IAEClass, "remaining() < 1");
2970 goto exit;
2971 }
2972 glGetTexParameterfv(
2973 (GLenum)target,
2974 (GLenum)pname,
2975 (GLfloat *)params
2976 );
2977
2978exit:
2979 if (_array) {
2980 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
2981 }
2982}
2983
2984/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
2985static void
2986android_glGetTexParameteriv__II_3II
2987 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
2988 jint _exception = 0;
2989 GLint *params_base = (GLint *) 0;
2990 jint _remaining;
2991 GLint *params = (GLint *) 0;
2992
2993 if (!params_ref) {
2994 _exception = 1;
2995 _env->ThrowNew(IAEClass, "params == null");
2996 goto exit;
2997 }
2998 if (offset < 0) {
2999 _exception = 1;
3000 _env->ThrowNew(IAEClass, "offset < 0");
3001 goto exit;
3002 }
3003 _remaining = _env->GetArrayLength(params_ref) - offset;
3004 if (_remaining < 1) {
3005 _exception = 1;
3006 _env->ThrowNew(IAEClass, "length - offset < 1");
3007 goto exit;
3008 }
3009 params_base = (GLint *)
3010 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
3011 params = params_base + offset;
3012
3013 glGetTexParameteriv(
3014 (GLenum)target,
3015 (GLenum)pname,
3016 (GLint *)params
3017 );
3018
3019exit:
3020 if (params_base) {
3021 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
3022 _exception ? JNI_ABORT: 0);
3023 }
3024}
3025
3026/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */
3027static void
3028android_glGetTexParameteriv__IILjava_nio_IntBuffer_2
3029 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
3030 jint _exception = 0;
3031 jarray _array = (jarray) 0;
3032 jint _remaining;
3033 GLint *params = (GLint *) 0;
3034
3035 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
3036 if (_remaining < 1) {
3037 _exception = 1;
3038 _env->ThrowNew(IAEClass, "remaining() < 1");
3039 goto exit;
3040 }
3041 glGetTexParameteriv(
3042 (GLenum)target,
3043 (GLenum)pname,
3044 (GLint *)params
3045 );
3046
3047exit:
3048 if (_array) {
3049 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
3050 }
3051}
3052
3053/* void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) */
3054static void
3055android_glGetUniformfv__II_3FI
3056 (JNIEnv *_env, jobject _this, jint program, jint location, jfloatArray params_ref, jint offset) {
3057 jint _exception = 0;
3058 GLfloat *params_base = (GLfloat *) 0;
3059 jint _remaining;
3060 GLfloat *params = (GLfloat *) 0;
3061
3062 if (!params_ref) {
3063 _exception = 1;
3064 _env->ThrowNew(IAEClass, "params == null");
3065 goto exit;
3066 }
3067 if (offset < 0) {
3068 _exception = 1;
3069 _env->ThrowNew(IAEClass, "offset < 0");
3070 goto exit;
3071 }
3072 _remaining = _env->GetArrayLength(params_ref) - offset;
3073 params_base = (GLfloat *)
3074 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
3075 params = params_base + offset;
3076
3077 glGetUniformfv(
3078 (GLuint)program,
3079 (GLint)location,
3080 (GLfloat *)params
3081 );
3082
3083exit:
3084 if (params_base) {
3085 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
3086 _exception ? JNI_ABORT: 0);
3087 }
3088}
3089
3090/* void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) */
3091static void
3092android_glGetUniformfv__IILjava_nio_FloatBuffer_2
3093 (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
3094 jint _exception = 0;
3095 jarray _array = (jarray) 0;
3096 jint _remaining;
3097 GLfloat *params = (GLfloat *) 0;
3098
3099 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
3100 glGetUniformfv(
3101 (GLuint)program,
3102 (GLint)location,
3103 (GLfloat *)params
3104 );
3105 if (_array) {
3106 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
3107 }
3108}
3109
3110/* void glGetUniformiv ( GLuint program, GLint location, GLint *params ) */
3111static void
3112android_glGetUniformiv__II_3II
3113 (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) {
3114 jint _exception = 0;
3115 GLint *params_base = (GLint *) 0;
3116 jint _remaining;
3117 GLint *params = (GLint *) 0;
3118
3119 if (!params_ref) {
3120 _exception = 1;
3121 _env->ThrowNew(IAEClass, "params == null");
3122 goto exit;
3123 }
3124 if (offset < 0) {
3125 _exception = 1;
3126 _env->ThrowNew(IAEClass, "offset < 0");
3127 goto exit;
3128 }
3129 _remaining = _env->GetArrayLength(params_ref) - offset;
3130 params_base = (GLint *)
3131 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
3132 params = params_base + offset;
3133
3134 glGetUniformiv(
3135 (GLuint)program,
3136 (GLint)location,
3137 (GLint *)params
3138 );
3139
3140exit:
3141 if (params_base) {
3142 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
3143 _exception ? JNI_ABORT: 0);
3144 }
3145}
3146
3147/* void glGetUniformiv ( GLuint program, GLint location, GLint *params ) */
3148static void
3149android_glGetUniformiv__IILjava_nio_IntBuffer_2
3150 (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
3151 jint _exception = 0;
3152 jarray _array = (jarray) 0;
3153 jint _remaining;
3154 GLint *params = (GLint *) 0;
3155
3156 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
3157 glGetUniformiv(
3158 (GLuint)program,
3159 (GLint)location,
3160 (GLint *)params
3161 );
3162 if (_array) {
3163 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
3164 }
3165}
3166
3167/* int glGetUniformLocation ( GLuint program, const char *name ) */
3168static jint
3169android_glGetUniformLocation__ILjava_lang_String_2
3170 (JNIEnv *_env, jobject _this, jint program, jstring name) {
3171 int _returnValue = 0;
3172 const char* _nativename = 0;
3173
3174 if (!name) {
3175 _env->ThrowNew(IAEClass, "name == null");
3176 goto exit;
3177 }
3178 _nativename = _env->GetStringUTFChars(name, 0);
3179
3180 _returnValue = glGetUniformLocation(
3181 (GLuint)program,
3182 (char *)_nativename
3183 );
3184
3185exit:
3186 if (_nativename) {
3187 _env->ReleaseStringUTFChars(name, _nativename);
3188 }
3189
3190 return _returnValue;
3191}
3192
3193/* void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) */
3194static void
3195android_glGetVertexAttribfv__II_3FI
3196 (JNIEnv *_env, jobject _this, jint index, jint pname, jfloatArray params_ref, jint offset) {
3197 jint _exception = 0;
3198 GLfloat *params_base = (GLfloat *) 0;
3199 jint _remaining;
3200 GLfloat *params = (GLfloat *) 0;
3201
3202 if (!params_ref) {
3203 _exception = 1;
3204 _env->ThrowNew(IAEClass, "params == null");
3205 goto exit;
3206 }
3207 if (offset < 0) {
3208 _exception = 1;
3209 _env->ThrowNew(IAEClass, "offset < 0");
3210 goto exit;
3211 }
3212 _remaining = _env->GetArrayLength(params_ref) - offset;
3213 params_base = (GLfloat *)
3214 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
3215 params = params_base + offset;
3216
3217 glGetVertexAttribfv(
3218 (GLuint)index,
3219 (GLenum)pname,
3220 (GLfloat *)params
3221 );
3222
3223exit:
3224 if (params_base) {
3225 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
3226 _exception ? JNI_ABORT: 0);
3227 }
3228}
3229
3230/* void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) */
3231static void
3232android_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2
3233 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
3234 jint _exception = 0;
3235 jarray _array = (jarray) 0;
3236 jint _remaining;
3237 GLfloat *params = (GLfloat *) 0;
3238
3239 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
3240 glGetVertexAttribfv(
3241 (GLuint)index,
3242 (GLenum)pname,
3243 (GLfloat *)params
3244 );
3245 if (_array) {
3246 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
3247 }
3248}
3249
3250/* void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) */
3251static void
3252android_glGetVertexAttribiv__II_3II
3253 (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
3254 jint _exception = 0;
3255 GLint *params_base = (GLint *) 0;
3256 jint _remaining;
3257 GLint *params = (GLint *) 0;
3258
3259 if (!params_ref) {
3260 _exception = 1;
3261 _env->ThrowNew(IAEClass, "params == null");
3262 goto exit;
3263 }
3264 if (offset < 0) {
3265 _exception = 1;
3266 _env->ThrowNew(IAEClass, "offset < 0");
3267 goto exit;
3268 }
3269 _remaining = _env->GetArrayLength(params_ref) - offset;
3270 params_base = (GLint *)
3271 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
3272 params = params_base + offset;
3273
3274 glGetVertexAttribiv(
3275 (GLuint)index,
3276 (GLenum)pname,
3277 (GLint *)params
3278 );
3279
3280exit:
3281 if (params_base) {
3282 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
3283 _exception ? JNI_ABORT: 0);
3284 }
3285}
3286
3287/* void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) */
3288static void
3289android_glGetVertexAttribiv__IILjava_nio_IntBuffer_2
3290 (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
3291 jint _exception = 0;
3292 jarray _array = (jarray) 0;
3293 jint _remaining;
3294 GLint *params = (GLint *) 0;
3295
3296 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
3297 glGetVertexAttribiv(
3298 (GLuint)index,
3299 (GLenum)pname,
3300 (GLint *)params
3301 );
3302 if (_array) {
3303 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
3304 }
3305}
3306
3307/* void glHint ( GLenum target, GLenum mode ) */
3308static void
3309android_glHint__II
3310 (JNIEnv *_env, jobject _this, jint target, jint mode) {
3311 glHint(
3312 (GLenum)target,
3313 (GLenum)mode
3314 );
3315}
3316
3317/* GLboolean glIsBuffer ( GLuint buffer ) */
3318static jboolean
3319android_glIsBuffer__I
3320 (JNIEnv *_env, jobject _this, jint buffer) {
3321 GLboolean _returnValue;
3322 _returnValue = glIsBuffer(
3323 (GLuint)buffer
3324 );
3325 return _returnValue;
3326}
3327
3328/* GLboolean glIsEnabled ( GLenum cap ) */
3329static jboolean
3330android_glIsEnabled__I
3331 (JNIEnv *_env, jobject _this, jint cap) {
3332 GLboolean _returnValue;
3333 _returnValue = glIsEnabled(
3334 (GLenum)cap
3335 );
3336 return _returnValue;
3337}
3338
3339/* GLboolean glIsFramebuffer ( GLuint framebuffer ) */
3340static jboolean
3341android_glIsFramebuffer__I
3342 (JNIEnv *_env, jobject _this, jint framebuffer) {
3343 GLboolean _returnValue;
3344 _returnValue = glIsFramebuffer(
3345 (GLuint)framebuffer
3346 );
3347 return _returnValue;
3348}
3349
3350/* GLboolean glIsProgram ( GLuint program ) */
3351static jboolean
3352android_glIsProgram__I
3353 (JNIEnv *_env, jobject _this, jint program) {
3354 GLboolean _returnValue;
3355 _returnValue = glIsProgram(
3356 (GLuint)program
3357 );
3358 return _returnValue;
3359}
3360
3361/* GLboolean glIsRenderbuffer ( GLuint renderbuffer ) */
3362static jboolean
3363android_glIsRenderbuffer__I
3364 (JNIEnv *_env, jobject _this, jint renderbuffer) {
3365 GLboolean _returnValue;
3366 _returnValue = glIsRenderbuffer(
3367 (GLuint)renderbuffer
3368 );
3369 return _returnValue;
3370}
3371
3372/* GLboolean glIsShader ( GLuint shader ) */
3373static jboolean
3374android_glIsShader__I
3375 (JNIEnv *_env, jobject _this, jint shader) {
3376 GLboolean _returnValue;
3377 _returnValue = glIsShader(
3378 (GLuint)shader
3379 );
3380 return _returnValue;
3381}
3382
3383/* GLboolean glIsTexture ( GLuint texture ) */
3384static jboolean
3385android_glIsTexture__I
3386 (JNIEnv *_env, jobject _this, jint texture) {
3387 GLboolean _returnValue;
3388 _returnValue = glIsTexture(
3389 (GLuint)texture
3390 );
3391 return _returnValue;
3392}
3393
3394/* void glLineWidth ( GLfloat width ) */
3395static void
3396android_glLineWidth__F
3397 (JNIEnv *_env, jobject _this, jfloat width) {
3398 glLineWidth(
3399 (GLfloat)width
3400 );
3401}
3402
3403/* void glLinkProgram ( GLuint program ) */
3404static void
3405android_glLinkProgram__I
3406 (JNIEnv *_env, jobject _this, jint program) {
3407 glLinkProgram(
3408 (GLuint)program
3409 );
3410}
3411
3412/* void glPixelStorei ( GLenum pname, GLint param ) */
3413static void
3414android_glPixelStorei__II
3415 (JNIEnv *_env, jobject _this, jint pname, jint param) {
3416 glPixelStorei(
3417 (GLenum)pname,
3418 (GLint)param
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 glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
3433static void
3434android_glReadPixels__IIIIIILjava_nio_Buffer_2
3435 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
3436 jint _exception = 0;
3437 jarray _array = (jarray) 0;
3438 jint _remaining;
3439 GLvoid *pixels = (GLvoid *) 0;
3440
3441 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
3442 glReadPixels(
3443 (GLint)x,
3444 (GLint)y,
3445 (GLsizei)width,
3446 (GLsizei)height,
3447 (GLenum)format,
3448 (GLenum)type,
3449 (GLvoid *)pixels
3450 );
3451 if (_array) {
3452 releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE);
3453 }
3454}
3455
3456/* void glReleaseShaderCompiler ( void ) */
3457static void
3458android_glReleaseShaderCompiler__
3459 (JNIEnv *_env, jobject _this) {
3460 glReleaseShaderCompiler();
3461}
3462
3463/* void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) */
3464static void
3465android_glRenderbufferStorage__IIII
3466 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) {
3467 glRenderbufferStorage(
3468 (GLenum)target,
3469 (GLenum)internalformat,
3470 (GLsizei)width,
3471 (GLsizei)height
3472 );
3473}
3474
3475/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
3476static void
3477android_glSampleCoverage__FZ
3478 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
3479 glSampleCoverage(
3480 (GLclampf)value,
3481 (GLboolean)invert
3482 );
3483}
3484
3485/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3486static void
3487android_glScissor__IIII
3488 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3489 glScissor(
3490 (GLint)x,
3491 (GLint)y,
3492 (GLsizei)width,
3493 (GLsizei)height
3494 );
3495}
3496
3497/* void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) */
3498static void
3499android_glShaderBinary__I_3IIILjava_nio_Buffer_2I
3500 (JNIEnv *_env, jobject _this, jint n, jintArray shaders_ref, jint offset, jint binaryformat, jobject binary_buf, jint length) {
3501 jarray _array = (jarray) 0;
3502 GLuint *shaders_base = (GLuint *) 0;
3503 jint _shadersRemaining;
3504 GLuint *shaders = (GLuint *) 0;
3505 jint _binaryRemaining;
3506 GLvoid *binary = (GLvoid *) 0;
3507
3508 if (!shaders_ref) {
3509 _env->ThrowNew(IAEClass, "shaders == null");
3510 goto exit;
3511 }
3512 if (offset < 0) {
3513 _env->ThrowNew(IAEClass, "offset < 0");
3514 goto exit;
3515 }
3516 _shadersRemaining = _env->GetArrayLength(shaders_ref) - offset;
3517 shaders_base = (GLuint *)
3518 _env->GetPrimitiveArrayCritical(shaders_ref, (jboolean *)0);
3519 shaders = shaders_base + offset;
3520
3521 binary = (GLvoid *)getPointer(_env, binary_buf, &_array, &_binaryRemaining);
3522 glShaderBinary(
3523 (GLsizei)n,
3524 (GLuint *)shaders,
3525 (GLenum)binaryformat,
3526 (GLvoid *)binary,
3527 (GLsizei)length
3528 );
3529
3530exit:
3531 if (_array) {
3532 releasePointer(_env, _array, binary, JNI_FALSE);
3533 }
3534 if (shaders_base) {
3535 _env->ReleasePrimitiveArrayCritical(shaders_ref, shaders_base,
3536 JNI_ABORT);
3537 }
3538}
3539
3540/* void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) */
3541static void
3542android_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I
3543 (JNIEnv *_env, jobject _this, jint n, jobject shaders_buf, jint binaryformat, jobject binary_buf, jint length) {
3544 jarray _shadersArray = (jarray) 0;
3545 jarray _binaryArray = (jarray) 0;
3546 jint _shadersRemaining;
3547 GLuint *shaders = (GLuint *) 0;
3548 jint _binaryRemaining;
3549 GLvoid *binary = (GLvoid *) 0;
3550
3551 shaders = (GLuint *)getPointer(_env, shaders_buf, &_shadersArray, &_shadersRemaining);
3552 binary = (GLvoid *)getPointer(_env, binary_buf, &_binaryArray, &_binaryRemaining);
3553 glShaderBinary(
3554 (GLsizei)n,
3555 (GLuint *)shaders,
3556 (GLenum)binaryformat,
3557 (GLvoid *)binary,
3558 (GLsizei)length
3559 );
3560 if (_shadersArray) {
3561 releasePointer(_env, _shadersArray, binary, JNI_FALSE);
3562 }
3563 if (_binaryArray) {
3564 releasePointer(_env, _binaryArray, shaders, JNI_FALSE);
3565 }
3566}
3567
3568
3569/* void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint * length ) */
3570static
3571void
3572android_glShaderSource
3573 (JNIEnv *_env, jobject _this, jint shader, jstring string) {
3574
3575 if (!string) {
3576 _env->ThrowNew(IAEClass, "string == null");
3577 return;
3578 }
3579
3580 const char* nativeString = _env->GetStringUTFChars(string, 0);
3581 const char* strings[] = {nativeString};
3582 glShaderSource(shader, 1, strings, 0);
3583 _env->ReleaseStringUTFChars(string, nativeString);
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 glStencilFuncSeparate ( GLenum face, GLenum func, GLint ref, GLuint mask ) */
3597static void
3598android_glStencilFuncSeparate__IIII
3599 (JNIEnv *_env, jobject _this, jint face, jint func, jint ref, jint mask) {
3600 glStencilFuncSeparate(
3601 (GLenum)face,
3602 (GLenum)func,
3603 (GLint)ref,
3604 (GLuint)mask
3605 );
3606}
3607
3608/* void glStencilMask ( GLuint mask ) */
3609static void
3610android_glStencilMask__I
3611 (JNIEnv *_env, jobject _this, jint mask) {
3612 glStencilMask(
3613 (GLuint)mask
3614 );
3615}
3616
3617/* void glStencilMaskSeparate ( GLenum face, GLuint mask ) */
3618static void
3619android_glStencilMaskSeparate__II
3620 (JNIEnv *_env, jobject _this, jint face, jint mask) {
3621 glStencilMaskSeparate(
3622 (GLenum)face,
3623 (GLuint)mask
3624 );
3625}
3626
3627/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
3628static void
3629android_glStencilOp__III
3630 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
3631 glStencilOp(
3632 (GLenum)fail,
3633 (GLenum)zfail,
3634 (GLenum)zpass
3635 );
3636}
3637
3638/* void glStencilOpSeparate ( GLenum face, GLenum fail, GLenum zfail, GLenum zpass ) */
3639static void
3640android_glStencilOpSeparate__IIII
3641 (JNIEnv *_env, jobject _this, jint face, jint fail, jint zfail, jint zpass) {
3642 glStencilOpSeparate(
3643 (GLenum)face,
3644 (GLenum)fail,
3645 (GLenum)zfail,
3646 (GLenum)zpass
3647 );
3648}
3649
3650/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
3651static void
3652android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
3653 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
3654 jarray _array = (jarray) 0;
3655 jint _remaining;
3656 GLvoid *pixels = (GLvoid *) 0;
3657
3658 if (pixels_buf) {
3659 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
3660 }
3661 glTexImage2D(
3662 (GLenum)target,
3663 (GLint)level,
3664 (GLint)internalformat,
3665 (GLsizei)width,
3666 (GLsizei)height,
3667 (GLint)border,
3668 (GLenum)format,
3669 (GLenum)type,
3670 (GLvoid *)pixels
3671 );
3672 if (_array) {
3673 releasePointer(_env, _array, pixels, JNI_FALSE);
3674 }
3675}
3676
3677/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
3678static void
3679android_glTexParameterf__IIF
3680 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3681 glTexParameterf(
3682 (GLenum)target,
3683 (GLenum)pname,
3684 (GLfloat)param
3685 );
3686}
3687
3688/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3689static void
3690android_glTexParameterfv__II_3FI
3691 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
3692 GLfloat *params_base = (GLfloat *) 0;
3693 jint _remaining;
3694 GLfloat *params = (GLfloat *) 0;
3695
3696 if (!params_ref) {
3697 _env->ThrowNew(IAEClass, "params == null");
3698 goto exit;
3699 }
3700 if (offset < 0) {
3701 _env->ThrowNew(IAEClass, "offset < 0");
3702 goto exit;
3703 }
3704 _remaining = _env->GetArrayLength(params_ref) - offset;
3705 if (_remaining < 1) {
3706 _env->ThrowNew(IAEClass, "length - offset < 1");
3707 goto exit;
3708 }
3709 params_base = (GLfloat *)
3710 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
3711 params = params_base + offset;
3712
3713 glTexParameterfv(
3714 (GLenum)target,
3715 (GLenum)pname,
3716 (GLfloat *)params
3717 );
3718
3719exit:
3720 if (params_base) {
3721 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
3722 JNI_ABORT);
3723 }
3724}
3725
3726/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3727static void
3728android_glTexParameterfv__IILjava_nio_FloatBuffer_2
3729 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
3730 jarray _array = (jarray) 0;
3731 jint _remaining;
3732 GLfloat *params = (GLfloat *) 0;
3733
3734 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining);
3735 if (_remaining < 1) {
3736 _env->ThrowNew(IAEClass, "remaining() < 1");
3737 goto exit;
3738 }
3739 glTexParameterfv(
3740 (GLenum)target,
3741 (GLenum)pname,
3742 (GLfloat *)params
3743 );
3744
3745exit:
3746 if (_array) {
3747 releasePointer(_env, _array, params, JNI_FALSE);
3748 }
3749}
3750
3751/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */
3752static void
3753android_glTexParameteri__III
3754 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3755 glTexParameteri(
3756 (GLenum)target,
3757 (GLenum)pname,
3758 (GLint)param
3759 );
3760}
3761
3762/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
3763static void
3764android_glTexParameteriv__II_3II
3765 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
3766 GLint *params_base = (GLint *) 0;
3767 jint _remaining;
3768 GLint *params = (GLint *) 0;
3769
3770 if (!params_ref) {
3771 _env->ThrowNew(IAEClass, "params == null");
3772 goto exit;
3773 }
3774 if (offset < 0) {
3775 _env->ThrowNew(IAEClass, "offset < 0");
3776 goto exit;
3777 }
3778 _remaining = _env->GetArrayLength(params_ref) - offset;
3779 if (_remaining < 1) {
3780 _env->ThrowNew(IAEClass, "length - offset < 1");
3781 goto exit;
3782 }
3783 params_base = (GLint *)
3784 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
3785 params = params_base + offset;
3786
3787 glTexParameteriv(
3788 (GLenum)target,
3789 (GLenum)pname,
3790 (GLint *)params
3791 );
3792
3793exit:
3794 if (params_base) {
3795 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
3796 JNI_ABORT);
3797 }
3798}
3799
3800/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */
3801static void
3802android_glTexParameteriv__IILjava_nio_IntBuffer_2
3803 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
3804 jarray _array = (jarray) 0;
3805 jint _remaining;
3806 GLint *params = (GLint *) 0;
3807
3808 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining);
3809 if (_remaining < 1) {
3810 _env->ThrowNew(IAEClass, "remaining() < 1");
3811 goto exit;
3812 }
3813 glTexParameteriv(
3814 (GLenum)target,
3815 (GLenum)pname,
3816 (GLint *)params
3817 );
3818
3819exit:
3820 if (_array) {
3821 releasePointer(_env, _array, params, JNI_FALSE);
3822 }
3823}
3824
3825/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
3826static void
3827android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
3828 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
3829 jarray _array = (jarray) 0;
3830 jint _remaining;
3831 GLvoid *pixels = (GLvoid *) 0;
3832
3833 if (pixels_buf) {
3834 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining);
3835 }
3836 glTexSubImage2D(
3837 (GLenum)target,
3838 (GLint)level,
3839 (GLint)xoffset,
3840 (GLint)yoffset,
3841 (GLsizei)width,
3842 (GLsizei)height,
3843 (GLenum)format,
3844 (GLenum)type,
3845 (GLvoid *)pixels
3846 );
3847 if (_array) {
3848 releasePointer(_env, _array, pixels, JNI_FALSE);
3849 }
3850}
3851
3852/* void glUniform1f ( GLint location, GLfloat x ) */
3853static void
3854android_glUniform1f__IF
3855 (JNIEnv *_env, jobject _this, jint location, jfloat x) {
3856 glUniform1f(
3857 (GLint)location,
3858 (GLfloat)x
3859 );
3860}
3861
3862/* void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) */
3863static void
3864android_glUniform1fv__II_3FI
3865 (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) {
3866 GLfloat *v_base = (GLfloat *) 0;
3867 jint _remaining;
3868 GLfloat *v = (GLfloat *) 0;
3869
3870 if (!v_ref) {
3871 _env->ThrowNew(IAEClass, "v == null");
3872 goto exit;
3873 }
3874 if (offset < 0) {
3875 _env->ThrowNew(IAEClass, "offset < 0");
3876 goto exit;
3877 }
3878 _remaining = _env->GetArrayLength(v_ref) - offset;
3879 v_base = (GLfloat *)
3880 _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
3881 v = v_base + offset;
3882
3883 glUniform1fv(
3884 (GLint)location,
3885 (GLsizei)count,
3886 (GLfloat *)v
3887 );
3888
3889exit:
3890 if (v_base) {
3891 _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
3892 JNI_ABORT);
3893 }
3894}
3895
3896/* void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) */
3897static void
3898android_glUniform1fv__IILjava_nio_FloatBuffer_2
3899 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
3900 jarray _array = (jarray) 0;
3901 jint _remaining;
3902 GLfloat *v = (GLfloat *) 0;
3903
3904 v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining);
3905 glUniform1fv(
3906 (GLint)location,
3907 (GLsizei)count,
3908 (GLfloat *)v
3909 );
3910 if (_array) {
3911 releasePointer(_env, _array, v, JNI_FALSE);
3912 }
3913}
3914
3915/* void glUniform1i ( GLint location, GLint x ) */
3916static void
3917android_glUniform1i__II
3918 (JNIEnv *_env, jobject _this, jint location, jint x) {
3919 glUniform1i(
3920 (GLint)location,
3921 (GLint)x
3922 );
3923}
3924
3925/* void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) */
3926static void
3927android_glUniform1iv__II_3II
3928 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) {
3929 GLint *v_base = (GLint *) 0;
3930 jint _remaining;
3931 GLint *v = (GLint *) 0;
3932
3933 if (!v_ref) {
3934 _env->ThrowNew(IAEClass, "v == null");
3935 goto exit;
3936 }
3937 if (offset < 0) {
3938 _env->ThrowNew(IAEClass, "offset < 0");
3939 goto exit;
3940 }
3941 _remaining = _env->GetArrayLength(v_ref) - offset;
3942 v_base = (GLint *)
3943 _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
3944 v = v_base + offset;
3945
3946 glUniform1iv(
3947 (GLint)location,
3948 (GLsizei)count,
3949 (GLint *)v
3950 );
3951
3952exit:
3953 if (v_base) {
3954 _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
3955 JNI_ABORT);
3956 }
3957}
3958
3959/* void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) */
3960static void
3961android_glUniform1iv__IILjava_nio_IntBuffer_2
3962 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
3963 jarray _array = (jarray) 0;
3964 jint _remaining;
3965 GLint *v = (GLint *) 0;
3966
3967 v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining);
3968 glUniform1iv(
3969 (GLint)location,
3970 (GLsizei)count,
3971 (GLint *)v
3972 );
3973 if (_array) {
3974 releasePointer(_env, _array, v, JNI_FALSE);
3975 }
3976}
3977
3978/* void glUniform2f ( GLint location, GLfloat x, GLfloat y ) */
3979static void
3980android_glUniform2f__IFF
3981 (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y) {
3982 glUniform2f(
3983 (GLint)location,
3984 (GLfloat)x,
3985 (GLfloat)y
3986 );
3987}
3988
3989/* void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) */
3990static void
3991android_glUniform2fv__II_3FI
3992 (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) {
3993 GLfloat *v_base = (GLfloat *) 0;
3994 jint _remaining;
3995 GLfloat *v = (GLfloat *) 0;
3996
3997 if (!v_ref) {
3998 _env->ThrowNew(IAEClass, "v == null");
3999 goto exit;
4000 }
4001 if (offset < 0) {
4002 _env->ThrowNew(IAEClass, "offset < 0");
4003 goto exit;
4004 }
4005 _remaining = _env->GetArrayLength(v_ref) - offset;
4006 v_base = (GLfloat *)
4007 _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
4008 v = v_base + offset;
4009
4010 glUniform2fv(
4011 (GLint)location,
4012 (GLsizei)count,
4013 (GLfloat *)v
4014 );
4015
4016exit:
4017 if (v_base) {
4018 _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
4019 JNI_ABORT);
4020 }
4021}
4022
4023/* void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) */
4024static void
4025android_glUniform2fv__IILjava_nio_FloatBuffer_2
4026 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
4027 jarray _array = (jarray) 0;
4028 jint _remaining;
4029 GLfloat *v = (GLfloat *) 0;
4030
4031 v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining);
4032 glUniform2fv(
4033 (GLint)location,
4034 (GLsizei)count,
4035 (GLfloat *)v
4036 );
4037 if (_array) {
4038 releasePointer(_env, _array, v, JNI_FALSE);
4039 }
4040}
4041
4042/* void glUniform2i ( GLint location, GLint x, GLint y ) */
4043static void
4044android_glUniform2i__III
4045 (JNIEnv *_env, jobject _this, jint location, jint x, jint y) {
4046 glUniform2i(
4047 (GLint)location,
4048 (GLint)x,
4049 (GLint)y
4050 );
4051}
4052
4053/* void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) */
4054static void
4055android_glUniform2iv__II_3II
4056 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) {
4057 GLint *v_base = (GLint *) 0;
4058 jint _remaining;
4059 GLint *v = (GLint *) 0;
4060
4061 if (!v_ref) {
4062 _env->ThrowNew(IAEClass, "v == null");
4063 goto exit;
4064 }
4065 if (offset < 0) {
4066 _env->ThrowNew(IAEClass, "offset < 0");
4067 goto exit;
4068 }
4069 _remaining = _env->GetArrayLength(v_ref) - offset;
4070 v_base = (GLint *)
4071 _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
4072 v = v_base + offset;
4073
4074 glUniform2iv(
4075 (GLint)location,
4076 (GLsizei)count,
4077 (GLint *)v
4078 );
4079
4080exit:
4081 if (v_base) {
4082 _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
4083 JNI_ABORT);
4084 }
4085}
4086
4087/* void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) */
4088static void
4089android_glUniform2iv__IILjava_nio_IntBuffer_2
4090 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
4091 jarray _array = (jarray) 0;
4092 jint _remaining;
4093 GLint *v = (GLint *) 0;
4094
4095 v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining);
4096 glUniform2iv(
4097 (GLint)location,
4098 (GLsizei)count,
4099 (GLint *)v
4100 );
4101 if (_array) {
4102 releasePointer(_env, _array, v, JNI_FALSE);
4103 }
4104}
4105
4106/* void glUniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z ) */
4107static void
4108android_glUniform3f__IFFF
4109 (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y, jfloat z) {
4110 glUniform3f(
4111 (GLint)location,
4112 (GLfloat)x,
4113 (GLfloat)y,
4114 (GLfloat)z
4115 );
4116}
4117
4118/* void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) */
4119static void
4120android_glUniform3fv__II_3FI
4121 (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) {
4122 GLfloat *v_base = (GLfloat *) 0;
4123 jint _remaining;
4124 GLfloat *v = (GLfloat *) 0;
4125
4126 if (!v_ref) {
4127 _env->ThrowNew(IAEClass, "v == null");
4128 goto exit;
4129 }
4130 if (offset < 0) {
4131 _env->ThrowNew(IAEClass, "offset < 0");
4132 goto exit;
4133 }
4134 _remaining = _env->GetArrayLength(v_ref) - offset;
4135 v_base = (GLfloat *)
4136 _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
4137 v = v_base + offset;
4138
4139 glUniform3fv(
4140 (GLint)location,
4141 (GLsizei)count,
4142 (GLfloat *)v
4143 );
4144
4145exit:
4146 if (v_base) {
4147 _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
4148 JNI_ABORT);
4149 }
4150}
4151
4152/* void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) */
4153static void
4154android_glUniform3fv__IILjava_nio_FloatBuffer_2
4155 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
4156 jarray _array = (jarray) 0;
4157 jint _remaining;
4158 GLfloat *v = (GLfloat *) 0;
4159
4160 v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining);
4161 glUniform3fv(
4162 (GLint)location,
4163 (GLsizei)count,
4164 (GLfloat *)v
4165 );
4166 if (_array) {
4167 releasePointer(_env, _array, v, JNI_FALSE);
4168 }
4169}
4170
4171/* void glUniform3i ( GLint location, GLint x, GLint y, GLint z ) */
4172static void
4173android_glUniform3i__IIII
4174 (JNIEnv *_env, jobject _this, jint location, jint x, jint y, jint z) {
4175 glUniform3i(
4176 (GLint)location,
4177 (GLint)x,
4178 (GLint)y,
4179 (GLint)z
4180 );
4181}
4182
4183/* void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) */
4184static void
4185android_glUniform3iv__II_3II
4186 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) {
4187 GLint *v_base = (GLint *) 0;
4188 jint _remaining;
4189 GLint *v = (GLint *) 0;
4190
4191 if (!v_ref) {
4192 _env->ThrowNew(IAEClass, "v == null");
4193 goto exit;
4194 }
4195 if (offset < 0) {
4196 _env->ThrowNew(IAEClass, "offset < 0");
4197 goto exit;
4198 }
4199 _remaining = _env->GetArrayLength(v_ref) - offset;
4200 v_base = (GLint *)
4201 _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
4202 v = v_base + offset;
4203
4204 glUniform3iv(
4205 (GLint)location,
4206 (GLsizei)count,
4207 (GLint *)v
4208 );
4209
4210exit:
4211 if (v_base) {
4212 _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
4213 JNI_ABORT);
4214 }
4215}
4216
4217/* void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) */
4218static void
4219android_glUniform3iv__IILjava_nio_IntBuffer_2
4220 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
4221 jarray _array = (jarray) 0;
4222 jint _remaining;
4223 GLint *v = (GLint *) 0;
4224
4225 v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining);
4226 glUniform3iv(
4227 (GLint)location,
4228 (GLsizei)count,
4229 (GLint *)v
4230 );
4231 if (_array) {
4232 releasePointer(_env, _array, v, JNI_FALSE);
4233 }
4234}
4235
4236/* void glUniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */
4237static void
4238android_glUniform4f__IFFFF
4239 (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y, jfloat z, jfloat w) {
4240 glUniform4f(
4241 (GLint)location,
4242 (GLfloat)x,
4243 (GLfloat)y,
4244 (GLfloat)z,
4245 (GLfloat)w
4246 );
4247}
4248
4249/* void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) */
4250static void
4251android_glUniform4fv__II_3FI
4252 (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) {
4253 GLfloat *v_base = (GLfloat *) 0;
4254 jint _remaining;
4255 GLfloat *v = (GLfloat *) 0;
4256
4257 if (!v_ref) {
4258 _env->ThrowNew(IAEClass, "v == null");
4259 goto exit;
4260 }
4261 if (offset < 0) {
4262 _env->ThrowNew(IAEClass, "offset < 0");
4263 goto exit;
4264 }
4265 _remaining = _env->GetArrayLength(v_ref) - offset;
4266 v_base = (GLfloat *)
4267 _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
4268 v = v_base + offset;
4269
4270 glUniform4fv(
4271 (GLint)location,
4272 (GLsizei)count,
4273 (GLfloat *)v
4274 );
4275
4276exit:
4277 if (v_base) {
4278 _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
4279 JNI_ABORT);
4280 }
4281}
4282
4283/* void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) */
4284static void
4285android_glUniform4fv__IILjava_nio_FloatBuffer_2
4286 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
4287 jarray _array = (jarray) 0;
4288 jint _remaining;
4289 GLfloat *v = (GLfloat *) 0;
4290
4291 v = (GLfloat *)getPointer(_env, v_buf, &_array, &_remaining);
4292 glUniform4fv(
4293 (GLint)location,
4294 (GLsizei)count,
4295 (GLfloat *)v
4296 );
4297 if (_array) {
4298 releasePointer(_env, _array, v, JNI_FALSE);
4299 }
4300}
4301
4302/* void glUniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w ) */
4303static void
4304android_glUniform4i__IIIII
4305 (JNIEnv *_env, jobject _this, jint location, jint x, jint y, jint z, jint w) {
4306 glUniform4i(
4307 (GLint)location,
4308 (GLint)x,
4309 (GLint)y,
4310 (GLint)z,
4311 (GLint)w
4312 );
4313}
4314
4315/* void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) */
4316static void
4317android_glUniform4iv__II_3II
4318 (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) {
4319 GLint *v_base = (GLint *) 0;
4320 jint _remaining;
4321 GLint *v = (GLint *) 0;
4322
4323 if (!v_ref) {
4324 _env->ThrowNew(IAEClass, "v == null");
4325 goto exit;
4326 }
4327 if (offset < 0) {
4328 _env->ThrowNew(IAEClass, "offset < 0");
4329 goto exit;
4330 }
4331 _remaining = _env->GetArrayLength(v_ref) - offset;
4332 v_base = (GLint *)
4333 _env->GetPrimitiveArrayCritical(v_ref, (jboolean *)0);
4334 v = v_base + offset;
4335
4336 glUniform4iv(
4337 (GLint)location,
4338 (GLsizei)count,
4339 (GLint *)v
4340 );
4341
4342exit:
4343 if (v_base) {
4344 _env->ReleasePrimitiveArrayCritical(v_ref, v_base,
4345 JNI_ABORT);
4346 }
4347}
4348
4349/* void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) */
4350static void
4351android_glUniform4iv__IILjava_nio_IntBuffer_2
4352 (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) {
4353 jarray _array = (jarray) 0;
4354 jint _remaining;
4355 GLint *v = (GLint *) 0;
4356
4357 v = (GLint *)getPointer(_env, v_buf, &_array, &_remaining);
4358 glUniform4iv(
4359 (GLint)location,
4360 (GLsizei)count,
4361 (GLint *)v
4362 );
4363 if (_array) {
4364 releasePointer(_env, _array, v, JNI_FALSE);
4365 }
4366}
4367
4368/* void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
4369static void
4370android_glUniformMatrix2fv__IIZ_3FI
4371 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
4372 GLfloat *value_base = (GLfloat *) 0;
4373 jint _remaining;
4374 GLfloat *value = (GLfloat *) 0;
4375
4376 if (!value_ref) {
4377 _env->ThrowNew(IAEClass, "value == null");
4378 goto exit;
4379 }
4380 if (offset < 0) {
4381 _env->ThrowNew(IAEClass, "offset < 0");
4382 goto exit;
4383 }
4384 _remaining = _env->GetArrayLength(value_ref) - offset;
4385 value_base = (GLfloat *)
4386 _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
4387 value = value_base + offset;
4388
4389 glUniformMatrix2fv(
4390 (GLint)location,
4391 (GLsizei)count,
4392 (GLboolean)transpose,
4393 (GLfloat *)value
4394 );
4395
4396exit:
4397 if (value_base) {
4398 _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
4399 JNI_ABORT);
4400 }
4401}
4402
4403/* void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
4404static void
4405android_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2
4406 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
4407 jarray _array = (jarray) 0;
4408 jint _remaining;
4409 GLfloat *value = (GLfloat *) 0;
4410
4411 value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining);
4412 glUniformMatrix2fv(
4413 (GLint)location,
4414 (GLsizei)count,
4415 (GLboolean)transpose,
4416 (GLfloat *)value
4417 );
4418 if (_array) {
4419 releasePointer(_env, _array, value, JNI_FALSE);
4420 }
4421}
4422
4423/* void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
4424static void
4425android_glUniformMatrix3fv__IIZ_3FI
4426 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
4427 GLfloat *value_base = (GLfloat *) 0;
4428 jint _remaining;
4429 GLfloat *value = (GLfloat *) 0;
4430
4431 if (!value_ref) {
4432 _env->ThrowNew(IAEClass, "value == null");
4433 goto exit;
4434 }
4435 if (offset < 0) {
4436 _env->ThrowNew(IAEClass, "offset < 0");
4437 goto exit;
4438 }
4439 _remaining = _env->GetArrayLength(value_ref) - offset;
4440 value_base = (GLfloat *)
4441 _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
4442 value = value_base + offset;
4443
4444 glUniformMatrix3fv(
4445 (GLint)location,
4446 (GLsizei)count,
4447 (GLboolean)transpose,
4448 (GLfloat *)value
4449 );
4450
4451exit:
4452 if (value_base) {
4453 _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
4454 JNI_ABORT);
4455 }
4456}
4457
4458/* void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
4459static void
4460android_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2
4461 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
4462 jarray _array = (jarray) 0;
4463 jint _remaining;
4464 GLfloat *value = (GLfloat *) 0;
4465
4466 value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining);
4467 glUniformMatrix3fv(
4468 (GLint)location,
4469 (GLsizei)count,
4470 (GLboolean)transpose,
4471 (GLfloat *)value
4472 );
4473 if (_array) {
4474 releasePointer(_env, _array, value, JNI_FALSE);
4475 }
4476}
4477
4478/* void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
4479static void
4480android_glUniformMatrix4fv__IIZ_3FI
4481 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
4482 GLfloat *value_base = (GLfloat *) 0;
4483 jint _remaining;
4484 GLfloat *value = (GLfloat *) 0;
4485
4486 if (!value_ref) {
4487 _env->ThrowNew(IAEClass, "value == null");
4488 goto exit;
4489 }
4490 if (offset < 0) {
4491 _env->ThrowNew(IAEClass, "offset < 0");
4492 goto exit;
4493 }
4494 _remaining = _env->GetArrayLength(value_ref) - offset;
4495 value_base = (GLfloat *)
4496 _env->GetPrimitiveArrayCritical(value_ref, (jboolean *)0);
4497 value = value_base + offset;
4498
4499 glUniformMatrix4fv(
4500 (GLint)location,
4501 (GLsizei)count,
4502 (GLboolean)transpose,
4503 (GLfloat *)value
4504 );
4505
4506exit:
4507 if (value_base) {
4508 _env->ReleasePrimitiveArrayCritical(value_ref, value_base,
4509 JNI_ABORT);
4510 }
4511}
4512
4513/* void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
4514static void
4515android_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2
4516 (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
4517 jarray _array = (jarray) 0;
4518 jint _remaining;
4519 GLfloat *value = (GLfloat *) 0;
4520
4521 value = (GLfloat *)getPointer(_env, value_buf, &_array, &_remaining);
4522 glUniformMatrix4fv(
4523 (GLint)location,
4524 (GLsizei)count,
4525 (GLboolean)transpose,
4526 (GLfloat *)value
4527 );
4528 if (_array) {
4529 releasePointer(_env, _array, value, JNI_FALSE);
4530 }
4531}
4532
4533/* void glUseProgram ( GLuint program ) */
4534static void
4535android_glUseProgram__I
4536 (JNIEnv *_env, jobject _this, jint program) {
4537 glUseProgram(
4538 (GLuint)program
4539 );
4540}
4541
4542/* void glValidateProgram ( GLuint program ) */
4543static void
4544android_glValidateProgram__I
4545 (JNIEnv *_env, jobject _this, jint program) {
4546 glValidateProgram(
4547 (GLuint)program
4548 );
4549}
4550
4551/* void glVertexAttrib1f ( GLuint indx, GLfloat x ) */
4552static void
4553android_glVertexAttrib1f__IF
4554 (JNIEnv *_env, jobject _this, jint indx, jfloat x) {
4555 glVertexAttrib1f(
4556 (GLuint)indx,
4557 (GLfloat)x
4558 );
4559}
4560
4561/* void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) */
4562static void
4563android_glVertexAttrib1fv__I_3FI
4564 (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) {
4565 GLfloat *values_base = (GLfloat *) 0;
4566 jint _remaining;
4567 GLfloat *values = (GLfloat *) 0;
4568
4569 if (!values_ref) {
4570 _env->ThrowNew(IAEClass, "values == null");
4571 goto exit;
4572 }
4573 if (offset < 0) {
4574 _env->ThrowNew(IAEClass, "offset < 0");
4575 goto exit;
4576 }
4577 _remaining = _env->GetArrayLength(values_ref) - offset;
4578 values_base = (GLfloat *)
4579 _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0);
4580 values = values_base + offset;
4581
4582 glVertexAttrib1fv(
4583 (GLuint)indx,
4584 (GLfloat *)values
4585 );
4586
4587exit:
4588 if (values_base) {
4589 _env->ReleasePrimitiveArrayCritical(values_ref, values_base,
4590 JNI_ABORT);
4591 }
4592}
4593
4594/* void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) */
4595static void
4596android_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2
4597 (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
4598 jarray _array = (jarray) 0;
4599 jint _remaining;
4600 GLfloat *values = (GLfloat *) 0;
4601
4602 values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining);
4603 glVertexAttrib1fv(
4604 (GLuint)indx,
4605 (GLfloat *)values
4606 );
4607 if (_array) {
4608 releasePointer(_env, _array, values, JNI_FALSE);
4609 }
4610}
4611
4612/* void glVertexAttrib2f ( GLuint indx, GLfloat x, GLfloat y ) */
4613static void
4614android_glVertexAttrib2f__IFF
4615 (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y) {
4616 glVertexAttrib2f(
4617 (GLuint)indx,
4618 (GLfloat)x,
4619 (GLfloat)y
4620 );
4621}
4622
4623/* void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) */
4624static void
4625android_glVertexAttrib2fv__I_3FI
4626 (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) {
4627 GLfloat *values_base = (GLfloat *) 0;
4628 jint _remaining;
4629 GLfloat *values = (GLfloat *) 0;
4630
4631 if (!values_ref) {
4632 _env->ThrowNew(IAEClass, "values == null");
4633 goto exit;
4634 }
4635 if (offset < 0) {
4636 _env->ThrowNew(IAEClass, "offset < 0");
4637 goto exit;
4638 }
4639 _remaining = _env->GetArrayLength(values_ref) - offset;
4640 values_base = (GLfloat *)
4641 _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0);
4642 values = values_base + offset;
4643
4644 glVertexAttrib2fv(
4645 (GLuint)indx,
4646 (GLfloat *)values
4647 );
4648
4649exit:
4650 if (values_base) {
4651 _env->ReleasePrimitiveArrayCritical(values_ref, values_base,
4652 JNI_ABORT);
4653 }
4654}
4655
4656/* void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) */
4657static void
4658android_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2
4659 (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
4660 jarray _array = (jarray) 0;
4661 jint _remaining;
4662 GLfloat *values = (GLfloat *) 0;
4663
4664 values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining);
4665 glVertexAttrib2fv(
4666 (GLuint)indx,
4667 (GLfloat *)values
4668 );
4669 if (_array) {
4670 releasePointer(_env, _array, values, JNI_FALSE);
4671 }
4672}
4673
4674/* void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) */
4675static void
4676android_glVertexAttrib3f__IFFF
4677 (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y, jfloat z) {
4678 glVertexAttrib3f(
4679 (GLuint)indx,
4680 (GLfloat)x,
4681 (GLfloat)y,
4682 (GLfloat)z
4683 );
4684}
4685
4686/* void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) */
4687static void
4688android_glVertexAttrib3fv__I_3FI
4689 (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) {
4690 GLfloat *values_base = (GLfloat *) 0;
4691 jint _remaining;
4692 GLfloat *values = (GLfloat *) 0;
4693
4694 if (!values_ref) {
4695 _env->ThrowNew(IAEClass, "values == null");
4696 goto exit;
4697 }
4698 if (offset < 0) {
4699 _env->ThrowNew(IAEClass, "offset < 0");
4700 goto exit;
4701 }
4702 _remaining = _env->GetArrayLength(values_ref) - offset;
4703 values_base = (GLfloat *)
4704 _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0);
4705 values = values_base + offset;
4706
4707 glVertexAttrib3fv(
4708 (GLuint)indx,
4709 (GLfloat *)values
4710 );
4711
4712exit:
4713 if (values_base) {
4714 _env->ReleasePrimitiveArrayCritical(values_ref, values_base,
4715 JNI_ABORT);
4716 }
4717}
4718
4719/* void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) */
4720static void
4721android_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2
4722 (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
4723 jarray _array = (jarray) 0;
4724 jint _remaining;
4725 GLfloat *values = (GLfloat *) 0;
4726
4727 values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining);
4728 glVertexAttrib3fv(
4729 (GLuint)indx,
4730 (GLfloat *)values
4731 );
4732 if (_array) {
4733 releasePointer(_env, _array, values, JNI_FALSE);
4734 }
4735}
4736
4737/* void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */
4738static void
4739android_glVertexAttrib4f__IFFFF
4740 (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y, jfloat z, jfloat w) {
4741 glVertexAttrib4f(
4742 (GLuint)indx,
4743 (GLfloat)x,
4744 (GLfloat)y,
4745 (GLfloat)z,
4746 (GLfloat)w
4747 );
4748}
4749
4750/* void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) */
4751static void
4752android_glVertexAttrib4fv__I_3FI
4753 (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) {
4754 GLfloat *values_base = (GLfloat *) 0;
4755 jint _remaining;
4756 GLfloat *values = (GLfloat *) 0;
4757
4758 if (!values_ref) {
4759 _env->ThrowNew(IAEClass, "values == null");
4760 goto exit;
4761 }
4762 if (offset < 0) {
4763 _env->ThrowNew(IAEClass, "offset < 0");
4764 goto exit;
4765 }
4766 _remaining = _env->GetArrayLength(values_ref) - offset;
4767 values_base = (GLfloat *)
4768 _env->GetPrimitiveArrayCritical(values_ref, (jboolean *)0);
4769 values = values_base + offset;
4770
4771 glVertexAttrib4fv(
4772 (GLuint)indx,
4773 (GLfloat *)values
4774 );
4775
4776exit:
4777 if (values_base) {
4778 _env->ReleasePrimitiveArrayCritical(values_ref, values_base,
4779 JNI_ABORT);
4780 }
4781}
4782
4783/* void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) */
4784static void
4785android_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2
4786 (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) {
4787 jarray _array = (jarray) 0;
4788 jint _remaining;
4789 GLfloat *values = (GLfloat *) 0;
4790
4791 values = (GLfloat *)getPointer(_env, values_buf, &_array, &_remaining);
4792 glVertexAttrib4fv(
4793 (GLuint)indx,
4794 (GLfloat *)values
4795 );
4796 if (_array) {
4797 releasePointer(_env, _array, values, JNI_FALSE);
4798 }
4799}
4800
Jack Palevich224107a2010-06-22 20:08:40 +08004801/* void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) */
4802static void
4803android_glVertexAttribPointer__IIIZII
4804 (JNIEnv *_env, jobject _this, jint indx, jint size, jint type, jboolean normalized, jint stride, jint offset) {
4805 glVertexAttribPointer(
4806 (GLuint)indx,
4807 (GLint)size,
4808 (GLenum)type,
4809 (GLboolean)normalized,
4810 (GLsizei)stride,
4811 (const GLvoid *)offset
4812 );
4813}
4814
Jack Palevich560814f2009-11-19 16:34:55 +08004815/* void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr ) */
4816static void
4817android_glVertexAttribPointerBounds__IIIZILjava_nio_Buffer_2I
4818 (JNIEnv *_env, jobject _this, jint indx, jint size, jint type, jboolean normalized, jint stride, jobject ptr_buf, jint remaining) {
4819 jarray _array = (jarray) 0;
4820 jint _remaining;
4821 GLvoid *ptr = (GLvoid *) 0;
4822
4823 if (ptr_buf) {
4824 ptr = (GLvoid *) getDirectBufferPointer(_env, ptr_buf);
4825 if ( ! ptr ) {
4826 return;
4827 }
4828 }
4829 glVertexAttribPointerBounds(
4830 (GLuint)indx,
4831 (GLint)size,
4832 (GLenum)type,
4833 (GLboolean)normalized,
4834 (GLsizei)stride,
4835 (GLvoid *)ptr,
4836 (GLsizei)remaining
4837 );
4838}
4839
4840/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
4841static void
4842android_glViewport__IIII
4843 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
4844 glViewport(
4845 (GLint)x,
4846 (GLint)y,
4847 (GLsizei)width,
4848 (GLsizei)height
4849 );
4850}
4851
4852static const char *classPathName = "android/opengl/GLES20";
4853
4854static JNINativeMethod methods[] = {
4855{"_nativeClassInit", "()V", (void*)nativeClassInit },
4856{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
4857{"glAttachShader", "(II)V", (void *) android_glAttachShader__II },
4858{"glBindAttribLocation", "(IILjava/lang/String;)V", (void *) android_glBindAttribLocation__IILjava_lang_String_2 },
4859{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II },
4860{"glBindFramebuffer", "(II)V", (void *) android_glBindFramebuffer__II },
4861{"glBindRenderbuffer", "(II)V", (void *) android_glBindRenderbuffer__II },
4862{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
4863{"glBlendColor", "(FFFF)V", (void *) android_glBlendColor__FFFF },
4864{"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I },
4865{"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II },
4866{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
4867{"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII },
4868{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I },
4869{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 },
4870{"glCheckFramebufferStatus", "(I)I", (void *) android_glCheckFramebufferStatus__I },
4871{"glClear", "(I)V", (void *) android_glClear__I },
4872{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
4873{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
4874{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
4875{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
4876{"glCompileShader", "(I)V", (void *) android_glCompileShader__I },
4877{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
4878{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
4879{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
4880{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
4881{"glCreateProgram", "()I", (void *) android_glCreateProgram__ },
4882{"glCreateShader", "(I)I", (void *) android_glCreateShader__I },
4883{"glCullFace", "(I)V", (void *) android_glCullFace__I },
4884{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II },
4885{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 },
4886{"glDeleteFramebuffers", "(I[II)V", (void *) android_glDeleteFramebuffers__I_3II },
4887{"glDeleteFramebuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffers__ILjava_nio_IntBuffer_2 },
4888{"glDeleteProgram", "(I)V", (void *) android_glDeleteProgram__I },
4889{"glDeleteRenderbuffers", "(I[II)V", (void *) android_glDeleteRenderbuffers__I_3II },
4890{"glDeleteRenderbuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2 },
4891{"glDeleteShader", "(I)V", (void *) android_glDeleteShader__I },
4892{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
4893{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
4894{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
4895{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
4896{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
4897{"glDetachShader", "(II)V", (void *) android_glDetachShader__II },
4898{"glDisable", "(I)V", (void *) android_glDisable__I },
4899{"glDisableVertexAttribArray", "(I)V", (void *) android_glDisableVertexAttribArray__I },
4900{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
Jack Palevich224107a2010-06-22 20:08:40 +08004901{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII },
Jack Palevich560814f2009-11-19 16:34:55 +08004902{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
4903{"glEnable", "(I)V", (void *) android_glEnable__I },
4904{"glEnableVertexAttribArray", "(I)V", (void *) android_glEnableVertexAttribArray__I },
4905{"glFinish", "()V", (void *) android_glFinish__ },
4906{"glFlush", "()V", (void *) android_glFlush__ },
4907{"glFramebufferRenderbuffer", "(IIII)V", (void *) android_glFramebufferRenderbuffer__IIII },
4908{"glFramebufferTexture2D", "(IIIII)V", (void *) android_glFramebufferTexture2D__IIIII },
4909{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
4910{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II },
4911{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 },
4912{"glGenerateMipmap", "(I)V", (void *) android_glGenerateMipmap__I },
4913{"glGenFramebuffers", "(I[II)V", (void *) android_glGenFramebuffers__I_3II },
4914{"glGenFramebuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffers__ILjava_nio_IntBuffer_2 },
4915{"glGenRenderbuffers", "(I[II)V", (void *) android_glGenRenderbuffers__I_3II },
4916{"glGenRenderbuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffers__ILjava_nio_IntBuffer_2 },
4917{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
4918{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
4919{"glGetActiveAttrib", "(III[II[II[II[BI)V", (void *) android_glGetActiveAttrib__III_3II_3II_3II_3BI },
4920{"glGetActiveAttrib", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B },
4921{"glGetActiveUniform", "(III[II[II[II[BI)V", (void *) android_glGetActiveUniform__III_3II_3II_3II_3BI },
4922{"glGetActiveUniform", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B },
4923{"glGetAttachedShaders", "(II[II[II)V", (void *) android_glGetAttachedShaders__II_3II_3II },
4924{"glGetAttachedShaders", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
4925{"glGetAttribLocation", "(ILjava/lang/String;)I", (void *) android_glGetAttribLocation__ILjava_lang_String_2 },
4926{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI },
4927{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 },
4928{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II },
4929{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 },
4930{"glGetError", "()I", (void *) android_glGetError__ },
4931{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI },
4932{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 },
4933{"glGetFramebufferAttachmentParameteriv", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameteriv__III_3II },
4934{"glGetFramebufferAttachmentParameteriv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameteriv__IIILjava_nio_IntBuffer_2 },
4935{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
4936{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
4937{"glGetProgramiv", "(II[II)V", (void *) android_glGetProgramiv__II_3II },
4938{"glGetProgramiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetProgramiv__IILjava_nio_IntBuffer_2 },
4939{"glGetProgramInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetProgramInfoLog },
4940{"glGetRenderbufferParameteriv", "(II[II)V", (void *) android_glGetRenderbufferParameteriv__II_3II },
4941{"glGetRenderbufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2 },
4942{"glGetShaderiv", "(II[II)V", (void *) android_glGetShaderiv__II_3II },
4943{"glGetShaderiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetShaderiv__IILjava_nio_IntBuffer_2 },
4944{"glGetShaderInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetShaderInfoLog },
4945{"glGetShaderPrecisionFormat", "(II[II[II)V", (void *) android_glGetShaderPrecisionFormat__II_3II_3II },
4946{"glGetShaderPrecisionFormat", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
4947{"glGetShaderSource", "(II[II[BI)V", (void *) android_glGetShaderSource__II_3II_3BI },
4948{"glGetShaderSource", "(IILjava/nio/IntBuffer;B)V", (void *) android_glGetShaderSource__IILjava_nio_IntBuffer_2B },
4949{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
4950{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI },
4951{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 },
4952{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II },
4953{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 },
4954{"glGetUniformfv", "(II[FI)V", (void *) android_glGetUniformfv__II_3FI },
4955{"glGetUniformfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetUniformfv__IILjava_nio_FloatBuffer_2 },
4956{"glGetUniformiv", "(II[II)V", (void *) android_glGetUniformiv__II_3II },
4957{"glGetUniformiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformiv__IILjava_nio_IntBuffer_2 },
4958{"glGetUniformLocation", "(ILjava/lang/String;)I", (void *) android_glGetUniformLocation__ILjava_lang_String_2 },
4959{"glGetVertexAttribfv", "(II[FI)V", (void *) android_glGetVertexAttribfv__II_3FI },
4960{"glGetVertexAttribfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2 },
4961{"glGetVertexAttribiv", "(II[II)V", (void *) android_glGetVertexAttribiv__II_3II },
4962{"glGetVertexAttribiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribiv__IILjava_nio_IntBuffer_2 },
4963{"glHint", "(II)V", (void *) android_glHint__II },
4964{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I },
4965{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I },
4966{"glIsFramebuffer", "(I)Z", (void *) android_glIsFramebuffer__I },
4967{"glIsProgram", "(I)Z", (void *) android_glIsProgram__I },
4968{"glIsRenderbuffer", "(I)Z", (void *) android_glIsRenderbuffer__I },
4969{"glIsShader", "(I)Z", (void *) android_glIsShader__I },
4970{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I },
4971{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
4972{"glLinkProgram", "(I)V", (void *) android_glLinkProgram__I },
4973{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
4974{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
4975{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
4976{"glReleaseShaderCompiler", "()V", (void *) android_glReleaseShaderCompiler__ },
4977{"glRenderbufferStorage", "(IIII)V", (void *) android_glRenderbufferStorage__IIII },
4978{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
4979{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
4980{"glShaderBinary", "(I[IIILjava/nio/Buffer;I)V", (void *) android_glShaderBinary__I_3IIILjava_nio_Buffer_2I },
4981{"glShaderBinary", "(ILjava/nio/IntBuffer;ILjava/nio/Buffer;I)V", (void *) android_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I },
4982{"glShaderSource", "(ILjava/lang/String;)V", (void *) android_glShaderSource },
4983{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
4984{"glStencilFuncSeparate", "(IIII)V", (void *) android_glStencilFuncSeparate__IIII },
4985{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
4986{"glStencilMaskSeparate", "(II)V", (void *) android_glStencilMaskSeparate__II },
4987{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
4988{"glStencilOpSeparate", "(IIII)V", (void *) android_glStencilOpSeparate__IIII },
4989{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
4990{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
4991{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI },
4992{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 },
4993{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III },
4994{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II },
4995{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 },
4996{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
4997{"glUniform1f", "(IF)V", (void *) android_glUniform1f__IF },
4998{"glUniform1fv", "(II[FI)V", (void *) android_glUniform1fv__II_3FI },
4999{"glUniform1fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform1fv__IILjava_nio_FloatBuffer_2 },
5000{"glUniform1i", "(II)V", (void *) android_glUniform1i__II },
5001{"glUniform1iv", "(II[II)V", (void *) android_glUniform1iv__II_3II },
5002{"glUniform1iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1iv__IILjava_nio_IntBuffer_2 },
5003{"glUniform2f", "(IFF)V", (void *) android_glUniform2f__IFF },
5004{"glUniform2fv", "(II[FI)V", (void *) android_glUniform2fv__II_3FI },
5005{"glUniform2fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform2fv__IILjava_nio_FloatBuffer_2 },
5006{"glUniform2i", "(III)V", (void *) android_glUniform2i__III },
5007{"glUniform2iv", "(II[II)V", (void *) android_glUniform2iv__II_3II },
5008{"glUniform2iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2iv__IILjava_nio_IntBuffer_2 },
5009{"glUniform3f", "(IFFF)V", (void *) android_glUniform3f__IFFF },
5010{"glUniform3fv", "(II[FI)V", (void *) android_glUniform3fv__II_3FI },
5011{"glUniform3fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform3fv__IILjava_nio_FloatBuffer_2 },
5012{"glUniform3i", "(IIII)V", (void *) android_glUniform3i__IIII },
5013{"glUniform3iv", "(II[II)V", (void *) android_glUniform3iv__II_3II },
5014{"glUniform3iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3iv__IILjava_nio_IntBuffer_2 },
5015{"glUniform4f", "(IFFFF)V", (void *) android_glUniform4f__IFFFF },
5016{"glUniform4fv", "(II[FI)V", (void *) android_glUniform4fv__II_3FI },
5017{"glUniform4fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform4fv__IILjava_nio_FloatBuffer_2 },
5018{"glUniform4i", "(IIIII)V", (void *) android_glUniform4i__IIIII },
5019{"glUniform4iv", "(II[II)V", (void *) android_glUniform4iv__II_3II },
5020{"glUniform4iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4iv__IILjava_nio_IntBuffer_2 },
5021{"glUniformMatrix2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2fv__IIZ_3FI },
5022{"glUniformMatrix2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2 },
5023{"glUniformMatrix3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3fv__IIZ_3FI },
5024{"glUniformMatrix3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2 },
5025{"glUniformMatrix4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4fv__IIZ_3FI },
5026{"glUniformMatrix4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2 },
5027{"glUseProgram", "(I)V", (void *) android_glUseProgram__I },
5028{"glValidateProgram", "(I)V", (void *) android_glValidateProgram__I },
5029{"glVertexAttrib1f", "(IF)V", (void *) android_glVertexAttrib1f__IF },
5030{"glVertexAttrib1fv", "(I[FI)V", (void *) android_glVertexAttrib1fv__I_3FI },
5031{"glVertexAttrib1fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2 },
5032{"glVertexAttrib2f", "(IFF)V", (void *) android_glVertexAttrib2f__IFF },
5033{"glVertexAttrib2fv", "(I[FI)V", (void *) android_glVertexAttrib2fv__I_3FI },
5034{"glVertexAttrib2fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2 },
5035{"glVertexAttrib3f", "(IFFF)V", (void *) android_glVertexAttrib3f__IFFF },
5036{"glVertexAttrib3fv", "(I[FI)V", (void *) android_glVertexAttrib3fv__I_3FI },
5037{"glVertexAttrib3fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2 },
5038{"glVertexAttrib4f", "(IFFFF)V", (void *) android_glVertexAttrib4f__IFFFF },
5039{"glVertexAttrib4fv", "(I[FI)V", (void *) android_glVertexAttrib4fv__I_3FI },
5040{"glVertexAttrib4fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2 },
Jack Palevich224107a2010-06-22 20:08:40 +08005041{"glVertexAttribPointer", "(IIIZII)V", (void *) android_glVertexAttribPointer__IIIZII },
Jack Palevich560814f2009-11-19 16:34:55 +08005042{"glVertexAttribPointerBounds", "(IIIZILjava/nio/Buffer;I)V", (void *) android_glVertexAttribPointerBounds__IIIZILjava_nio_Buffer_2I },
5043{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
5044};
5045
5046int register_android_opengl_jni_GLES20(JNIEnv *_env)
5047{
5048 int err;
5049 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
5050 return err;
5051}