blob: 336c0ec27c8b326a01ad2ff4eca4ac1824dcf406 [file] [log] [blame]
Jack Palevich27f80022009-04-15 19:13:17 -07001/*
2**
3** Copyright 2009, The Android Open Source Project
4**
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07005** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
Jack Palevich27f80022009-04-15 19:13:17 -07008**
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07009** http://www.apache.org/licenses/LICENSE-2.0
Jack Palevich27f80022009-04-15 19:13:17 -070010**
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070011** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
Jack Palevich27f80022009-04-15 19:13:17 -070015** limitations under the License.
16*/
17
18// This source file is automatically generated
19
Mathias Agopian15284de2013-02-23 03:12:30 -080020#include <GLES/gl.h>
21#include <GLES/glext.h>
22
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070023#include "jni.h"
24#include "JNIHelp.h"
Jack Palevich27f80022009-04-15 19:13:17 -070025#include <android_runtime/AndroidRuntime.h>
26#include <utils/misc.h>
Jack Palevich27f80022009-04-15 19:13:17 -070027#include <assert.h>
Mathias Agopian8331f722009-05-08 15:35:17 -070028
Jack Palevich27f80022009-04-15 19:13:17 -070029static int initialized = 0;
30
31static jclass nioAccessClass;
32static jclass bufferClass;
Jack Palevich27f80022009-04-15 19:13:17 -070033static jmethodID getBasePointerID;
34static jmethodID getBaseArrayID;
35static jmethodID getBaseArrayOffsetID;
36static jfieldID positionID;
37static jfieldID limitID;
38static jfieldID elementSizeShiftID;
39
Mathias Agopian15284de2013-02-23 03:12:30 -080040
41/* special calls implemented in Android's GLES wrapper used to more
42 * efficiently bound-check passed arrays */
43extern "C" {
44#ifdef GL_VERSION_ES_CM_1_1
45GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
46 const GLvoid *ptr, GLsizei count);
47GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
48 const GLvoid *pointer, GLsizei count);
49GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
50 GLsizei stride, const GLvoid *pointer, GLsizei count);
51GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
52 GLsizei stride, const GLvoid *pointer, GLsizei count);
53GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
54 GLsizei stride, const GLvoid *pointer, GLsizei count);
55GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
56 GLsizei stride, const GLvoid *pointer, GLsizei count);
57GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
58 GLsizei stride, const GLvoid *pointer, GLsizei count);
59#endif
60#ifdef GL_ES_VERSION_2_0
61static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
62 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
63 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
64}
65#endif
66}
67
Jack Palevich27f80022009-04-15 19:13:17 -070068/* Cache method IDs each time the class is loaded. */
69
70static void
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070071nativeClassInit(JNIEnv *_env, jclass glImplClass)
Jack Palevich27f80022009-04-15 19:13:17 -070072{
73 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
74 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
75
76 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
77 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
78
79 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
80 "getBasePointer", "(Ljava/nio/Buffer;)J");
81 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
82 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
83 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
84 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
85
86 positionID = _env->GetFieldID(bufferClass, "position", "I");
87 limitID = _env->GetFieldID(bufferClass, "limit", "I");
88 elementSizeShiftID =
89 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
90}
91
Jack Palevich27f80022009-04-15 19:13:17 -070092static void *
Thomas Tafertshofer17045a12012-07-12 13:55:55 -070093getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
Jack Palevich27f80022009-04-15 19:13:17 -070094{
95 jint position;
96 jint limit;
97 jint elementSizeShift;
98 jlong pointer;
Jack Palevich27f80022009-04-15 19:13:17 -070099
100 position = _env->GetIntField(buffer, positionID);
101 limit = _env->GetIntField(buffer, limitID);
102 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
103 *remaining = (limit - position) << elementSizeShift;
104 pointer = _env->CallStaticLongMethod(nioAccessClass,
105 getBasePointerID, buffer);
106 if (pointer != 0L) {
107 *array = NULL;
108 return (void *) (jint) pointer;
109 }
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700110
Jack Palevich27f80022009-04-15 19:13:17 -0700111 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
112 getBaseArrayID, buffer);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700113 *offset = _env->CallStaticIntMethod(nioAccessClass,
Jack Palevich27f80022009-04-15 19:13:17 -0700114 getBaseArrayOffsetID, buffer);
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700115
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700116 return NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700117}
118
Jack Palevich27f80022009-04-15 19:13:17 -0700119static void
120releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
121{
122 _env->ReleasePrimitiveArrayCritical(array, data,
Mathias Agopian15284de2013-02-23 03:12:30 -0800123 commit ? 0 : JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -0700124}
125
Jack Palevich16e79722009-05-15 18:13:34 -0700126static void *
127getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
128 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
129 if (buf) {
130 jint position = _env->GetIntField(buffer, positionID);
131 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
132 buf += position << elementSizeShift;
133 } else {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700134 jniThrowException(_env, "java/lang/IllegalArgumentException",
135 "Must use a native order direct Buffer");
Jack Palevich16e79722009-05-15 18:13:34 -0700136 }
137 return (void*) buf;
138}
139
Mathias Agopian15284de2013-02-23 03:12:30 -0800140// --------------------------------------------------------------------------
141
142/*
143 * returns the number of values glGet returns for a given pname.
144 *
145 * The code below is written such that pnames requiring only one values
146 * are the default (and are not explicitely tested for). This makes the
147 * checking code much shorter/readable/efficient.
148 *
149 * This means that unknown pnames (e.g.: extensions) will default to 1. If
150 * that unknown pname needs more than 1 value, then the validation check
151 * is incomplete and the app may crash if it passed the wrong number params.
152 */
153static int getNeededCount(GLint pname) {
154 int needed = 1;
155#ifdef GL_ES_VERSION_2_0
156 // GLES 2.x pnames
157 switch (pname) {
158 case GL_ALIASED_LINE_WIDTH_RANGE:
159 case GL_ALIASED_POINT_SIZE_RANGE:
160 needed = 2;
161 break;
162
163 case GL_BLEND_COLOR:
164 case GL_COLOR_CLEAR_VALUE:
165 case GL_COLOR_WRITEMASK:
166 case GL_SCISSOR_BOX:
167 case GL_VIEWPORT:
168 needed = 4;
169 break;
170
171 case GL_COMPRESSED_TEXTURE_FORMATS:
172 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
173 break;
174
175 case GL_SHADER_BINARY_FORMATS:
176 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
177 break;
178 }
179#endif
180
181#ifdef GL_VERSION_ES_CM_1_1
182 // GLES 1.x pnames
183 switch (pname) {
184 case GL_ALIASED_LINE_WIDTH_RANGE:
185 case GL_ALIASED_POINT_SIZE_RANGE:
186 case GL_DEPTH_RANGE:
187 case GL_SMOOTH_LINE_WIDTH_RANGE:
188 case GL_SMOOTH_POINT_SIZE_RANGE:
189 needed = 2;
190 break;
191
192 case GL_CURRENT_NORMAL:
193 case GL_POINT_DISTANCE_ATTENUATION:
194 needed = 3;
195 break;
196
197 case GL_COLOR_CLEAR_VALUE:
198 case GL_COLOR_WRITEMASK:
199 case GL_CURRENT_COLOR:
200 case GL_CURRENT_TEXTURE_COORDS:
201 case GL_FOG_COLOR:
202 case GL_LIGHT_MODEL_AMBIENT:
203 case GL_SCISSOR_BOX:
204 case GL_VIEWPORT:
205 needed = 4;
206 break;
207
208 case GL_MODELVIEW_MATRIX:
209 case GL_PROJECTION_MATRIX:
210 case GL_TEXTURE_MATRIX:
211 needed = 16;
212 break;
213
214 case GL_COMPRESSED_TEXTURE_FORMATS:
215 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
216 break;
217 }
218#endif
219 return needed;
220}
221
222template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)>
223static void
224get
225 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
226 jint _exception = 0;
227 const char * _exceptionType;
228 const char * _exceptionMessage;
229 CTYPE *params_base = (CTYPE *) 0;
230 jint _remaining;
231 CTYPE *params = (CTYPE *) 0;
232 int _needed = 0;
233
234 if (!params_ref) {
235 _exception = 1;
236 _exceptionType = "java/lang/IllegalArgumentException";
237 _exceptionMessage = "params == null";
238 goto exit;
239 }
240 if (offset < 0) {
241 _exception = 1;
242 _exceptionType = "java/lang/IllegalArgumentException";
243 _exceptionMessage = "offset < 0";
244 goto exit;
245 }
246 _remaining = _env->GetArrayLength(params_ref) - offset;
247 _needed = getNeededCount(pname);
248 // if we didn't find this pname, we just assume the user passed
249 // an array of the right size -- this might happen with extensions
250 // or if we forget an enum here.
251 if (_remaining < _needed) {
252 _exception = 1;
253 _exceptionType = "java/lang/IllegalArgumentException";
254 _exceptionMessage = "length - offset < needed";
255 goto exit;
256 }
257 params_base = (CTYPE *)
258 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
259 params = params_base + offset;
260
261 GET(
262 (GLenum)pname,
263 (CTYPE *)params
264 );
265
266exit:
267 if (params_base) {
268 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
269 _exception ? JNI_ABORT: 0);
270 }
271 if (_exception) {
272 jniThrowException(_env, _exceptionType, _exceptionMessage);
273 }
274}
275
276
277template <typename CTYPE, void GET(GLenum, CTYPE*)>
278static void
279getarray
280 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
281 jint _exception = 0;
282 const char * _exceptionType;
283 const char * _exceptionMessage;
284 jarray _array = (jarray) 0;
285 jint _bufferOffset = (jint) 0;
286 jint _remaining;
287 CTYPE *params = (CTYPE *) 0;
288 int _needed = 0;
289
290 params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
291 _needed = getNeededCount(pname);
292 // if we didn't find this pname, we just assume the user passed
293 // an array of the right size -- this might happen with extensions
294 // or if we forget an enum here.
295 if (_needed>0 && _remaining < _needed) {
296 _exception = 1;
297 _exceptionType = "java/lang/IllegalArgumentException";
298 _exceptionMessage = "remaining() < needed";
299 goto exit;
300 }
301 if (params == NULL) {
302 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
303 params = (CTYPE *) (_paramsBase + _bufferOffset);
304 }
305 GET(
306 (GLenum)pname,
307 (CTYPE *)params
308 );
309
310exit:
311 if (_array) {
312 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
313 }
314 if (_exception) {
315 jniThrowException(_env, _exceptionType, _exceptionMessage);
316 }
Jack Palevichbe509c92009-05-07 09:52:14 -0700317}
318
Jack Palevich27f80022009-04-15 19:13:17 -0700319// --------------------------------------------------------------------------
Jack Palevich27f80022009-04-15 19:13:17 -0700320/* void glActiveTexture ( GLenum texture ) */
321static void
322android_glActiveTexture__I
323 (JNIEnv *_env, jobject _this, jint texture) {
324 glActiveTexture(
325 (GLenum)texture
326 );
327}
328
329/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
330static void
331android_glAlphaFunc__IF
332 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
333 glAlphaFunc(
334 (GLenum)func,
335 (GLclampf)ref
336 );
337}
338
339/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
340static void
341android_glAlphaFuncx__II
342 (JNIEnv *_env, jobject _this, jint func, jint ref) {
343 glAlphaFuncx(
344 (GLenum)func,
345 (GLclampx)ref
346 );
347}
348
349/* void glBindTexture ( GLenum target, GLuint texture ) */
350static void
351android_glBindTexture__II
352 (JNIEnv *_env, jobject _this, jint target, jint texture) {
353 glBindTexture(
354 (GLenum)target,
355 (GLuint)texture
356 );
357}
358
359/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
360static void
361android_glBlendFunc__II
362 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
363 glBlendFunc(
364 (GLenum)sfactor,
365 (GLenum)dfactor
366 );
367}
368
369/* void glClear ( GLbitfield mask ) */
370static void
371android_glClear__I
372 (JNIEnv *_env, jobject _this, jint mask) {
373 glClear(
374 (GLbitfield)mask
375 );
376}
377
378/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
379static void
380android_glClearColor__FFFF
381 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
382 glClearColor(
383 (GLclampf)red,
384 (GLclampf)green,
385 (GLclampf)blue,
386 (GLclampf)alpha
387 );
388}
389
390/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
391static void
392android_glClearColorx__IIII
393 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
394 glClearColorx(
395 (GLclampx)red,
396 (GLclampx)green,
397 (GLclampx)blue,
398 (GLclampx)alpha
399 );
400}
401
402/* void glClearDepthf ( GLclampf depth ) */
403static void
404android_glClearDepthf__F
405 (JNIEnv *_env, jobject _this, jfloat depth) {
406 glClearDepthf(
407 (GLclampf)depth
408 );
409}
410
411/* void glClearDepthx ( GLclampx depth ) */
412static void
413android_glClearDepthx__I
414 (JNIEnv *_env, jobject _this, jint depth) {
415 glClearDepthx(
416 (GLclampx)depth
417 );
418}
419
420/* void glClearStencil ( GLint s ) */
421static void
422android_glClearStencil__I
423 (JNIEnv *_env, jobject _this, jint s) {
424 glClearStencil(
425 (GLint)s
426 );
427}
428
429/* void glClientActiveTexture ( GLenum texture ) */
430static void
431android_glClientActiveTexture__I
432 (JNIEnv *_env, jobject _this, jint texture) {
433 glClientActiveTexture(
434 (GLenum)texture
435 );
436}
437
438/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
439static void
440android_glColor4f__FFFF
441 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
442 glColor4f(
443 (GLfloat)red,
444 (GLfloat)green,
445 (GLfloat)blue,
446 (GLfloat)alpha
447 );
448}
449
450/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
451static void
452android_glColor4x__IIII
453 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
454 glColor4x(
455 (GLfixed)red,
456 (GLfixed)green,
457 (GLfixed)blue,
458 (GLfixed)alpha
459 );
460}
461
462/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
463static void
464android_glColorMask__ZZZZ
465 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
466 glColorMask(
467 (GLboolean)red,
468 (GLboolean)green,
469 (GLboolean)blue,
470 (GLboolean)alpha
471 );
472}
473
474/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
475static void
476android_glColorPointerBounds__IIILjava_nio_Buffer_2I
477 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
478 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700479 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700480 jint _remaining;
481 GLvoid *pointer = (GLvoid *) 0;
482
Jack Paleviche20ea782009-05-07 18:28:29 -0700483 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -0700484 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -0700485 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -0700486 return;
487 }
488 }
Jack Palevich27f80022009-04-15 19:13:17 -0700489 glColorPointerBounds(
490 (GLint)size,
491 (GLenum)type,
492 (GLsizei)stride,
493 (GLvoid *)pointer,
494 (GLsizei)remaining
495 );
Jack Palevich27f80022009-04-15 19:13:17 -0700496}
497
498/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
499static void
500android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
501 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
502 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700503 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700504 jint _remaining;
505 GLvoid *data = (GLvoid *) 0;
506
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700507 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
508 if (data == NULL) {
509 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
510 data = (GLvoid *) (_dataBase + _bufferOffset);
511 }
Jack Palevich27f80022009-04-15 19:13:17 -0700512 glCompressedTexImage2D(
513 (GLenum)target,
514 (GLint)level,
515 (GLenum)internalformat,
516 (GLsizei)width,
517 (GLsizei)height,
518 (GLint)border,
519 (GLsizei)imageSize,
520 (GLvoid *)data
521 );
522 if (_array) {
523 releasePointer(_env, _array, data, JNI_FALSE);
524 }
525}
526
527/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
528static void
529android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
530 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
531 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700532 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700533 jint _remaining;
534 GLvoid *data = (GLvoid *) 0;
535
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700536 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
537 if (data == NULL) {
538 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
539 data = (GLvoid *) (_dataBase + _bufferOffset);
540 }
Jack Palevich27f80022009-04-15 19:13:17 -0700541 glCompressedTexSubImage2D(
542 (GLenum)target,
543 (GLint)level,
544 (GLint)xoffset,
545 (GLint)yoffset,
546 (GLsizei)width,
547 (GLsizei)height,
548 (GLenum)format,
549 (GLsizei)imageSize,
550 (GLvoid *)data
551 );
552 if (_array) {
553 releasePointer(_env, _array, data, JNI_FALSE);
554 }
555}
556
557/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
558static void
559android_glCopyTexImage2D__IIIIIIII
560 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
561 glCopyTexImage2D(
562 (GLenum)target,
563 (GLint)level,
564 (GLenum)internalformat,
565 (GLint)x,
566 (GLint)y,
567 (GLsizei)width,
568 (GLsizei)height,
569 (GLint)border
570 );
571}
572
573/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
574static void
575android_glCopyTexSubImage2D__IIIIIIII
576 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
577 glCopyTexSubImage2D(
578 (GLenum)target,
579 (GLint)level,
580 (GLint)xoffset,
581 (GLint)yoffset,
582 (GLint)x,
583 (GLint)y,
584 (GLsizei)width,
585 (GLsizei)height
586 );
587}
588
589/* void glCullFace ( GLenum mode ) */
590static void
591android_glCullFace__I
592 (JNIEnv *_env, jobject _this, jint mode) {
593 glCullFace(
594 (GLenum)mode
595 );
596}
597
598/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
599static void
600android_glDeleteTextures__I_3II
601 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700602 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800603 const char * _exceptionType = NULL;
604 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700605 GLuint *textures_base = (GLuint *) 0;
606 jint _remaining;
607 GLuint *textures = (GLuint *) 0;
608
609 if (!textures_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700610 _exception = 1;
611 _exceptionType = "java/lang/IllegalArgumentException";
612 _exceptionMessage = "textures == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700613 goto exit;
614 }
615 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700616 _exception = 1;
617 _exceptionType = "java/lang/IllegalArgumentException";
618 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -0700619 goto exit;
620 }
621 _remaining = _env->GetArrayLength(textures_ref) - offset;
622 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700623 _exception = 1;
624 _exceptionType = "java/lang/IllegalArgumentException";
625 _exceptionMessage = "length - offset < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700626 goto exit;
627 }
628 textures_base = (GLuint *)
629 _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
630 textures = textures_base + offset;
631
632 glDeleteTextures(
633 (GLsizei)n,
634 (GLuint *)textures
635 );
636
637exit:
638 if (textures_base) {
639 _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
640 JNI_ABORT);
641 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700642 if (_exception) {
643 jniThrowException(_env, _exceptionType, _exceptionMessage);
644 }
Jack Palevich27f80022009-04-15 19:13:17 -0700645}
646
647/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
648static void
649android_glDeleteTextures__ILjava_nio_IntBuffer_2
650 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700651 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800652 const char * _exceptionType = NULL;
653 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700654 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700655 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700656 jint _remaining;
657 GLuint *textures = (GLuint *) 0;
658
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700659 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700660 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700661 _exception = 1;
662 _exceptionType = "java/lang/IllegalArgumentException";
663 _exceptionMessage = "remaining() < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700664 goto exit;
665 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700666 if (textures == NULL) {
667 char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
668 textures = (GLuint *) (_texturesBase + _bufferOffset);
669 }
Jack Palevich27f80022009-04-15 19:13:17 -0700670 glDeleteTextures(
671 (GLsizei)n,
672 (GLuint *)textures
673 );
674
675exit:
676 if (_array) {
677 releasePointer(_env, _array, textures, JNI_FALSE);
678 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700679 if (_exception) {
680 jniThrowException(_env, _exceptionType, _exceptionMessage);
681 }
Jack Palevich27f80022009-04-15 19:13:17 -0700682}
683
684/* void glDepthFunc ( GLenum func ) */
685static void
686android_glDepthFunc__I
687 (JNIEnv *_env, jobject _this, jint func) {
688 glDepthFunc(
689 (GLenum)func
690 );
691}
692
693/* void glDepthMask ( GLboolean flag ) */
694static void
695android_glDepthMask__Z
696 (JNIEnv *_env, jobject _this, jboolean flag) {
697 glDepthMask(
698 (GLboolean)flag
699 );
700}
701
702/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
703static void
704android_glDepthRangef__FF
705 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
706 glDepthRangef(
707 (GLclampf)zNear,
708 (GLclampf)zFar
709 );
710}
711
712/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
713static void
714android_glDepthRangex__II
715 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
716 glDepthRangex(
717 (GLclampx)zNear,
718 (GLclampx)zFar
719 );
720}
721
722/* void glDisable ( GLenum cap ) */
723static void
724android_glDisable__I
725 (JNIEnv *_env, jobject _this, jint cap) {
726 glDisable(
727 (GLenum)cap
728 );
729}
730
731/* void glDisableClientState ( GLenum array ) */
732static void
733android_glDisableClientState__I
734 (JNIEnv *_env, jobject _this, jint array) {
735 glDisableClientState(
736 (GLenum)array
737 );
738}
739
740/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
741static void
742android_glDrawArrays__III
743 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
744 glDrawArrays(
745 (GLenum)mode,
746 (GLint)first,
747 (GLsizei)count
748 );
749}
750
751/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
752static void
753android_glDrawElements__IIILjava_nio_Buffer_2
754 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700755 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800756 const char * _exceptionType = NULL;
757 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700758 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700759 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700760 jint _remaining;
761 GLvoid *indices = (GLvoid *) 0;
762
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700763 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700764 if (_remaining < count) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700765 _exception = 1;
766 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
767 _exceptionMessage = "remaining() < count < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700768 goto exit;
769 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700770 if (indices == NULL) {
771 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
772 indices = (GLvoid *) (_indicesBase + _bufferOffset);
773 }
Jack Palevich27f80022009-04-15 19:13:17 -0700774 glDrawElements(
775 (GLenum)mode,
776 (GLsizei)count,
777 (GLenum)type,
778 (GLvoid *)indices
779 );
780
781exit:
782 if (_array) {
783 releasePointer(_env, _array, indices, JNI_FALSE);
784 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700785 if (_exception) {
786 jniThrowException(_env, _exceptionType, _exceptionMessage);
787 }
Jack Palevich27f80022009-04-15 19:13:17 -0700788}
789
790/* void glEnable ( GLenum cap ) */
791static void
792android_glEnable__I
793 (JNIEnv *_env, jobject _this, jint cap) {
794 glEnable(
795 (GLenum)cap
796 );
797}
798
799/* void glEnableClientState ( GLenum array ) */
800static void
801android_glEnableClientState__I
802 (JNIEnv *_env, jobject _this, jint array) {
803 glEnableClientState(
804 (GLenum)array
805 );
806}
807
808/* void glFinish ( void ) */
809static void
810android_glFinish__
811 (JNIEnv *_env, jobject _this) {
812 glFinish();
813}
814
815/* void glFlush ( void ) */
816static void
817android_glFlush__
818 (JNIEnv *_env, jobject _this) {
819 glFlush();
820}
821
822/* void glFogf ( GLenum pname, GLfloat param ) */
823static void
824android_glFogf__IF
825 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
826 glFogf(
827 (GLenum)pname,
828 (GLfloat)param
829 );
830}
831
832/* void glFogfv ( GLenum pname, const GLfloat *params ) */
833static void
834android_glFogfv__I_3FI
835 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700836 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800837 const char * _exceptionType = NULL;
838 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700839 GLfloat *params_base = (GLfloat *) 0;
840 jint _remaining;
841 GLfloat *params = (GLfloat *) 0;
842
843 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700844 _exception = 1;
845 _exceptionType = "java/lang/IllegalArgumentException";
846 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700847 goto exit;
848 }
849 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700850 _exception = 1;
851 _exceptionType = "java/lang/IllegalArgumentException";
852 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -0700853 goto exit;
854 }
855 _remaining = _env->GetArrayLength(params_ref) - offset;
856 int _needed;
857 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -0700858#if defined(GL_FOG_COLOR)
859 case GL_FOG_COLOR:
860#endif // defined(GL_FOG_COLOR)
861 _needed = 4;
862 break;
863 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800864 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -0700865 break;
866 }
867 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700868 _exception = 1;
869 _exceptionType = "java/lang/IllegalArgumentException";
870 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700871 goto exit;
872 }
873 params_base = (GLfloat *)
874 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
875 params = params_base + offset;
876
877 glFogfv(
878 (GLenum)pname,
879 (GLfloat *)params
880 );
881
882exit:
883 if (params_base) {
884 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
885 JNI_ABORT);
886 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700887 if (_exception) {
888 jniThrowException(_env, _exceptionType, _exceptionMessage);
889 }
Jack Palevich27f80022009-04-15 19:13:17 -0700890}
891
892/* void glFogfv ( GLenum pname, const GLfloat *params ) */
893static void
894android_glFogfv__ILjava_nio_FloatBuffer_2
895 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700896 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800897 const char * _exceptionType = NULL;
898 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700899 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700900 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700901 jint _remaining;
902 GLfloat *params = (GLfloat *) 0;
903
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700904 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700905 int _needed;
906 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -0700907#if defined(GL_FOG_COLOR)
908 case GL_FOG_COLOR:
909#endif // defined(GL_FOG_COLOR)
910 _needed = 4;
911 break;
912 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800913 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -0700914 break;
915 }
916 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700917 _exception = 1;
918 _exceptionType = "java/lang/IllegalArgumentException";
919 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700920 goto exit;
921 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700922 if (params == NULL) {
923 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
924 params = (GLfloat *) (_paramsBase + _bufferOffset);
925 }
Jack Palevich27f80022009-04-15 19:13:17 -0700926 glFogfv(
927 (GLenum)pname,
928 (GLfloat *)params
929 );
930
931exit:
932 if (_array) {
933 releasePointer(_env, _array, params, JNI_FALSE);
934 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700935 if (_exception) {
936 jniThrowException(_env, _exceptionType, _exceptionMessage);
937 }
Jack Palevich27f80022009-04-15 19:13:17 -0700938}
939
940/* void glFogx ( GLenum pname, GLfixed param ) */
941static void
942android_glFogx__II
943 (JNIEnv *_env, jobject _this, jint pname, jint param) {
944 glFogx(
945 (GLenum)pname,
946 (GLfixed)param
947 );
948}
949
950/* void glFogxv ( GLenum pname, const GLfixed *params ) */
951static void
952android_glFogxv__I_3II
953 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700954 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -0800955 const char * _exceptionType = NULL;
956 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700957 GLfixed *params_base = (GLfixed *) 0;
958 jint _remaining;
959 GLfixed *params = (GLfixed *) 0;
960
961 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700962 _exception = 1;
963 _exceptionType = "java/lang/IllegalArgumentException";
964 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700965 goto exit;
966 }
967 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700968 _exception = 1;
969 _exceptionType = "java/lang/IllegalArgumentException";
970 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -0700971 goto exit;
972 }
973 _remaining = _env->GetArrayLength(params_ref) - offset;
974 int _needed;
975 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -0700976#if defined(GL_FOG_COLOR)
977 case GL_FOG_COLOR:
978#endif // defined(GL_FOG_COLOR)
979 _needed = 4;
980 break;
981 default:
Mathias Agopian15284de2013-02-23 03:12:30 -0800982 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -0700983 break;
984 }
985 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700986 _exception = 1;
987 _exceptionType = "java/lang/IllegalArgumentException";
988 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700989 goto exit;
990 }
991 params_base = (GLfixed *)
992 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
993 params = params_base + offset;
994
995 glFogxv(
996 (GLenum)pname,
997 (GLfixed *)params
998 );
999
1000exit:
1001 if (params_base) {
1002 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1003 JNI_ABORT);
1004 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001005 if (_exception) {
1006 jniThrowException(_env, _exceptionType, _exceptionMessage);
1007 }
Jack Palevich27f80022009-04-15 19:13:17 -07001008}
1009
1010/* void glFogxv ( GLenum pname, const GLfixed *params ) */
1011static void
1012android_glFogxv__ILjava_nio_IntBuffer_2
1013 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001014 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001015 const char * _exceptionType = NULL;
1016 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001017 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001018 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001019 jint _remaining;
1020 GLfixed *params = (GLfixed *) 0;
1021
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001022 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001023 int _needed;
1024 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001025#if defined(GL_FOG_COLOR)
1026 case GL_FOG_COLOR:
1027#endif // defined(GL_FOG_COLOR)
1028 _needed = 4;
1029 break;
1030 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001031 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001032 break;
1033 }
1034 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001035 _exception = 1;
1036 _exceptionType = "java/lang/IllegalArgumentException";
1037 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001038 goto exit;
1039 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001040 if (params == NULL) {
1041 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1042 params = (GLfixed *) (_paramsBase + _bufferOffset);
1043 }
Jack Palevich27f80022009-04-15 19:13:17 -07001044 glFogxv(
1045 (GLenum)pname,
1046 (GLfixed *)params
1047 );
1048
1049exit:
1050 if (_array) {
1051 releasePointer(_env, _array, params, JNI_FALSE);
1052 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001053 if (_exception) {
1054 jniThrowException(_env, _exceptionType, _exceptionMessage);
1055 }
Jack Palevich27f80022009-04-15 19:13:17 -07001056}
1057
1058/* void glFrontFace ( GLenum mode ) */
1059static void
1060android_glFrontFace__I
1061 (JNIEnv *_env, jobject _this, jint mode) {
1062 glFrontFace(
1063 (GLenum)mode
1064 );
1065}
1066
1067/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1068static void
1069android_glFrustumf__FFFFFF
1070 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1071 glFrustumf(
1072 (GLfloat)left,
1073 (GLfloat)right,
1074 (GLfloat)bottom,
1075 (GLfloat)top,
1076 (GLfloat)zNear,
1077 (GLfloat)zFar
1078 );
1079}
1080
1081/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1082static void
1083android_glFrustumx__IIIIII
1084 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1085 glFrustumx(
1086 (GLfixed)left,
1087 (GLfixed)right,
1088 (GLfixed)bottom,
1089 (GLfixed)top,
1090 (GLfixed)zNear,
1091 (GLfixed)zFar
1092 );
1093}
1094
1095/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1096static void
1097android_glGenTextures__I_3II
1098 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1099 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001100 const char * _exceptionType = NULL;
1101 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001102 GLuint *textures_base = (GLuint *) 0;
1103 jint _remaining;
1104 GLuint *textures = (GLuint *) 0;
1105
1106 if (!textures_ref) {
1107 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001108 _exceptionType = "java/lang/IllegalArgumentException";
1109 _exceptionMessage = "textures == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001110 goto exit;
1111 }
1112 if (offset < 0) {
1113 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001114 _exceptionType = "java/lang/IllegalArgumentException";
1115 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001116 goto exit;
1117 }
1118 _remaining = _env->GetArrayLength(textures_ref) - offset;
1119 if (_remaining < n) {
1120 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001121 _exceptionType = "java/lang/IllegalArgumentException";
1122 _exceptionMessage = "length - offset < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001123 goto exit;
1124 }
1125 textures_base = (GLuint *)
1126 _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
1127 textures = textures_base + offset;
1128
1129 glGenTextures(
1130 (GLsizei)n,
1131 (GLuint *)textures
1132 );
1133
1134exit:
1135 if (textures_base) {
1136 _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
1137 _exception ? JNI_ABORT: 0);
1138 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001139 if (_exception) {
1140 jniThrowException(_env, _exceptionType, _exceptionMessage);
1141 }
Jack Palevich27f80022009-04-15 19:13:17 -07001142}
1143
1144/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1145static void
1146android_glGenTextures__ILjava_nio_IntBuffer_2
1147 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1148 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001149 const char * _exceptionType = NULL;
1150 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001151 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001152 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001153 jint _remaining;
1154 GLuint *textures = (GLuint *) 0;
1155
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001156 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001157 if (_remaining < n) {
1158 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001159 _exceptionType = "java/lang/IllegalArgumentException";
1160 _exceptionMessage = "remaining() < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001161 goto exit;
1162 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001163 if (textures == NULL) {
1164 char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1165 textures = (GLuint *) (_texturesBase + _bufferOffset);
1166 }
Jack Palevich27f80022009-04-15 19:13:17 -07001167 glGenTextures(
1168 (GLsizei)n,
1169 (GLuint *)textures
1170 );
1171
1172exit:
1173 if (_array) {
1174 releasePointer(_env, _array, textures, _exception ? JNI_FALSE : JNI_TRUE);
1175 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001176 if (_exception) {
1177 jniThrowException(_env, _exceptionType, _exceptionMessage);
1178 }
Jack Palevich27f80022009-04-15 19:13:17 -07001179}
1180
1181/* GLenum glGetError ( void ) */
1182static jint
1183android_glGetError__
1184 (JNIEnv *_env, jobject _this) {
1185 GLenum _returnValue;
1186 _returnValue = glGetError();
1187 return _returnValue;
1188}
1189
1190/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1191static void
1192android_glGetIntegerv__I_3II
1193 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Mathias Agopian15284de2013-02-23 03:12:30 -08001194 get<jintArray, GLint, glGetIntegerv>(_env, _this, pname, params_ref, offset);
Jack Palevich27f80022009-04-15 19:13:17 -07001195}
1196
1197/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1198static void
1199android_glGetIntegerv__ILjava_nio_IntBuffer_2
1200 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Mathias Agopian15284de2013-02-23 03:12:30 -08001201 getarray<GLint, glGetIntegerv>(_env, _this, pname, params_buf);
Jack Palevich27f80022009-04-15 19:13:17 -07001202}
1203
Jack Palevich27f80022009-04-15 19:13:17 -07001204/* const GLubyte * glGetString ( GLenum name ) */
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07001205static jstring android_glGetString(JNIEnv* _env, jobject, jint name) {
1206 const char* chars = (const char*) glGetString((GLenum) name);
1207 return _env->NewStringUTF(chars);
Jack Palevich27f80022009-04-15 19:13:17 -07001208}
1209/* void glHint ( GLenum target, GLenum mode ) */
1210static void
1211android_glHint__II
1212 (JNIEnv *_env, jobject _this, jint target, jint mode) {
1213 glHint(
1214 (GLenum)target,
1215 (GLenum)mode
1216 );
1217}
1218
1219/* void glLightModelf ( GLenum pname, GLfloat param ) */
1220static void
1221android_glLightModelf__IF
1222 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1223 glLightModelf(
1224 (GLenum)pname,
1225 (GLfloat)param
1226 );
1227}
1228
1229/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1230static void
1231android_glLightModelfv__I_3FI
1232 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001233 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001234 const char * _exceptionType = NULL;
1235 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001236 GLfloat *params_base = (GLfloat *) 0;
1237 jint _remaining;
1238 GLfloat *params = (GLfloat *) 0;
1239
1240 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001241 _exception = 1;
1242 _exceptionType = "java/lang/IllegalArgumentException";
1243 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001244 goto exit;
1245 }
1246 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001247 _exception = 1;
1248 _exceptionType = "java/lang/IllegalArgumentException";
1249 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001250 goto exit;
1251 }
1252 _remaining = _env->GetArrayLength(params_ref) - offset;
1253 int _needed;
1254 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001255#if defined(GL_LIGHT_MODEL_AMBIENT)
1256 case GL_LIGHT_MODEL_AMBIENT:
1257#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1258 _needed = 4;
1259 break;
1260 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001261 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001262 break;
1263 }
1264 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001265 _exception = 1;
1266 _exceptionType = "java/lang/IllegalArgumentException";
1267 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001268 goto exit;
1269 }
1270 params_base = (GLfloat *)
1271 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1272 params = params_base + offset;
1273
1274 glLightModelfv(
1275 (GLenum)pname,
1276 (GLfloat *)params
1277 );
1278
1279exit:
1280 if (params_base) {
1281 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1282 JNI_ABORT);
1283 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001284 if (_exception) {
1285 jniThrowException(_env, _exceptionType, _exceptionMessage);
1286 }
Jack Palevich27f80022009-04-15 19:13:17 -07001287}
1288
1289/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1290static void
1291android_glLightModelfv__ILjava_nio_FloatBuffer_2
1292 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001293 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001294 const char * _exceptionType = NULL;
1295 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001296 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001297 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001298 jint _remaining;
1299 GLfloat *params = (GLfloat *) 0;
1300
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001301 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001302 int _needed;
1303 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001304#if defined(GL_LIGHT_MODEL_AMBIENT)
1305 case GL_LIGHT_MODEL_AMBIENT:
1306#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1307 _needed = 4;
1308 break;
1309 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001310 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001311 break;
1312 }
1313 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001314 _exception = 1;
1315 _exceptionType = "java/lang/IllegalArgumentException";
1316 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001317 goto exit;
1318 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001319 if (params == NULL) {
1320 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1321 params = (GLfloat *) (_paramsBase + _bufferOffset);
1322 }
Jack Palevich27f80022009-04-15 19:13:17 -07001323 glLightModelfv(
1324 (GLenum)pname,
1325 (GLfloat *)params
1326 );
1327
1328exit:
1329 if (_array) {
1330 releasePointer(_env, _array, params, JNI_FALSE);
1331 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001332 if (_exception) {
1333 jniThrowException(_env, _exceptionType, _exceptionMessage);
1334 }
Jack Palevich27f80022009-04-15 19:13:17 -07001335}
1336
1337/* void glLightModelx ( GLenum pname, GLfixed param ) */
1338static void
1339android_glLightModelx__II
1340 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1341 glLightModelx(
1342 (GLenum)pname,
1343 (GLfixed)param
1344 );
1345}
1346
1347/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1348static void
1349android_glLightModelxv__I_3II
1350 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001351 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001352 const char * _exceptionType = NULL;
1353 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001354 GLfixed *params_base = (GLfixed *) 0;
1355 jint _remaining;
1356 GLfixed *params = (GLfixed *) 0;
1357
1358 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001359 _exception = 1;
1360 _exceptionType = "java/lang/IllegalArgumentException";
1361 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001362 goto exit;
1363 }
1364 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001365 _exception = 1;
1366 _exceptionType = "java/lang/IllegalArgumentException";
1367 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001368 goto exit;
1369 }
1370 _remaining = _env->GetArrayLength(params_ref) - offset;
1371 int _needed;
1372 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001373#if defined(GL_LIGHT_MODEL_AMBIENT)
1374 case GL_LIGHT_MODEL_AMBIENT:
1375#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1376 _needed = 4;
1377 break;
1378 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001379 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001380 break;
1381 }
1382 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001383 _exception = 1;
1384 _exceptionType = "java/lang/IllegalArgumentException";
1385 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001386 goto exit;
1387 }
1388 params_base = (GLfixed *)
1389 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1390 params = params_base + offset;
1391
1392 glLightModelxv(
1393 (GLenum)pname,
1394 (GLfixed *)params
1395 );
1396
1397exit:
1398 if (params_base) {
1399 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1400 JNI_ABORT);
1401 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001402 if (_exception) {
1403 jniThrowException(_env, _exceptionType, _exceptionMessage);
1404 }
Jack Palevich27f80022009-04-15 19:13:17 -07001405}
1406
1407/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1408static void
1409android_glLightModelxv__ILjava_nio_IntBuffer_2
1410 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001411 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001412 const char * _exceptionType = NULL;
1413 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001414 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001415 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001416 jint _remaining;
1417 GLfixed *params = (GLfixed *) 0;
1418
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001419 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001420 int _needed;
1421 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001422#if defined(GL_LIGHT_MODEL_AMBIENT)
1423 case GL_LIGHT_MODEL_AMBIENT:
1424#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1425 _needed = 4;
1426 break;
1427 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001428 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001429 break;
1430 }
1431 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001432 _exception = 1;
1433 _exceptionType = "java/lang/IllegalArgumentException";
1434 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001435 goto exit;
1436 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001437 if (params == NULL) {
1438 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1439 params = (GLfixed *) (_paramsBase + _bufferOffset);
1440 }
Jack Palevich27f80022009-04-15 19:13:17 -07001441 glLightModelxv(
1442 (GLenum)pname,
1443 (GLfixed *)params
1444 );
1445
1446exit:
1447 if (_array) {
1448 releasePointer(_env, _array, params, JNI_FALSE);
1449 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001450 if (_exception) {
1451 jniThrowException(_env, _exceptionType, _exceptionMessage);
1452 }
Jack Palevich27f80022009-04-15 19:13:17 -07001453}
1454
1455/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
1456static void
1457android_glLightf__IIF
1458 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
1459 glLightf(
1460 (GLenum)light,
1461 (GLenum)pname,
1462 (GLfloat)param
1463 );
1464}
1465
1466/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1467static void
1468android_glLightfv__II_3FI
1469 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001470 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001471 const char * _exceptionType = NULL;
1472 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001473 GLfloat *params_base = (GLfloat *) 0;
1474 jint _remaining;
1475 GLfloat *params = (GLfloat *) 0;
1476
1477 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001478 _exception = 1;
1479 _exceptionType = "java/lang/IllegalArgumentException";
1480 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001481 goto exit;
1482 }
1483 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001484 _exception = 1;
1485 _exceptionType = "java/lang/IllegalArgumentException";
1486 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001487 goto exit;
1488 }
1489 _remaining = _env->GetArrayLength(params_ref) - offset;
1490 int _needed;
1491 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001492#if defined(GL_SPOT_DIRECTION)
1493 case GL_SPOT_DIRECTION:
1494#endif // defined(GL_SPOT_DIRECTION)
1495 _needed = 3;
1496 break;
1497#if defined(GL_AMBIENT)
1498 case GL_AMBIENT:
1499#endif // defined(GL_AMBIENT)
1500#if defined(GL_DIFFUSE)
1501 case GL_DIFFUSE:
1502#endif // defined(GL_DIFFUSE)
1503#if defined(GL_SPECULAR)
1504 case GL_SPECULAR:
1505#endif // defined(GL_SPECULAR)
1506#if defined(GL_EMISSION)
1507 case GL_EMISSION:
1508#endif // defined(GL_EMISSION)
1509 _needed = 4;
1510 break;
1511 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001512 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001513 break;
1514 }
1515 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001516 _exception = 1;
1517 _exceptionType = "java/lang/IllegalArgumentException";
1518 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001519 goto exit;
1520 }
1521 params_base = (GLfloat *)
1522 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1523 params = params_base + offset;
1524
1525 glLightfv(
1526 (GLenum)light,
1527 (GLenum)pname,
1528 (GLfloat *)params
1529 );
1530
1531exit:
1532 if (params_base) {
1533 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1534 JNI_ABORT);
1535 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001536 if (_exception) {
1537 jniThrowException(_env, _exceptionType, _exceptionMessage);
1538 }
Jack Palevich27f80022009-04-15 19:13:17 -07001539}
1540
1541/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1542static void
1543android_glLightfv__IILjava_nio_FloatBuffer_2
1544 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001545 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001546 const char * _exceptionType = NULL;
1547 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001548 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001549 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001550 jint _remaining;
1551 GLfloat *params = (GLfloat *) 0;
1552
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001553 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001554 int _needed;
1555 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001556#if defined(GL_SPOT_DIRECTION)
1557 case GL_SPOT_DIRECTION:
1558#endif // defined(GL_SPOT_DIRECTION)
1559 _needed = 3;
1560 break;
1561#if defined(GL_AMBIENT)
1562 case GL_AMBIENT:
1563#endif // defined(GL_AMBIENT)
1564#if defined(GL_DIFFUSE)
1565 case GL_DIFFUSE:
1566#endif // defined(GL_DIFFUSE)
1567#if defined(GL_SPECULAR)
1568 case GL_SPECULAR:
1569#endif // defined(GL_SPECULAR)
1570#if defined(GL_EMISSION)
1571 case GL_EMISSION:
1572#endif // defined(GL_EMISSION)
1573 _needed = 4;
1574 break;
1575 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001576 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001577 break;
1578 }
1579 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001580 _exception = 1;
1581 _exceptionType = "java/lang/IllegalArgumentException";
1582 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001583 goto exit;
1584 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001585 if (params == NULL) {
1586 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1587 params = (GLfloat *) (_paramsBase + _bufferOffset);
1588 }
Jack Palevich27f80022009-04-15 19:13:17 -07001589 glLightfv(
1590 (GLenum)light,
1591 (GLenum)pname,
1592 (GLfloat *)params
1593 );
1594
1595exit:
1596 if (_array) {
1597 releasePointer(_env, _array, params, JNI_FALSE);
1598 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001599 if (_exception) {
1600 jniThrowException(_env, _exceptionType, _exceptionMessage);
1601 }
Jack Palevich27f80022009-04-15 19:13:17 -07001602}
1603
1604/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
1605static void
1606android_glLightx__III
1607 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
1608 glLightx(
1609 (GLenum)light,
1610 (GLenum)pname,
1611 (GLfixed)param
1612 );
1613}
1614
1615/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1616static void
1617android_glLightxv__II_3II
1618 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001619 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001620 const char * _exceptionType = NULL;
1621 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001622 GLfixed *params_base = (GLfixed *) 0;
1623 jint _remaining;
1624 GLfixed *params = (GLfixed *) 0;
1625
1626 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001627 _exception = 1;
1628 _exceptionType = "java/lang/IllegalArgumentException";
1629 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001630 goto exit;
1631 }
1632 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001633 _exception = 1;
1634 _exceptionType = "java/lang/IllegalArgumentException";
1635 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001636 goto exit;
1637 }
1638 _remaining = _env->GetArrayLength(params_ref) - offset;
1639 int _needed;
1640 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001641#if defined(GL_SPOT_DIRECTION)
1642 case GL_SPOT_DIRECTION:
1643#endif // defined(GL_SPOT_DIRECTION)
1644 _needed = 3;
1645 break;
1646#if defined(GL_AMBIENT)
1647 case GL_AMBIENT:
1648#endif // defined(GL_AMBIENT)
1649#if defined(GL_DIFFUSE)
1650 case GL_DIFFUSE:
1651#endif // defined(GL_DIFFUSE)
1652#if defined(GL_SPECULAR)
1653 case GL_SPECULAR:
1654#endif // defined(GL_SPECULAR)
1655#if defined(GL_EMISSION)
1656 case GL_EMISSION:
1657#endif // defined(GL_EMISSION)
1658 _needed = 4;
1659 break;
1660 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001661 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001662 break;
1663 }
1664 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001665 _exception = 1;
1666 _exceptionType = "java/lang/IllegalArgumentException";
1667 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001668 goto exit;
1669 }
1670 params_base = (GLfixed *)
1671 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1672 params = params_base + offset;
1673
1674 glLightxv(
1675 (GLenum)light,
1676 (GLenum)pname,
1677 (GLfixed *)params
1678 );
1679
1680exit:
1681 if (params_base) {
1682 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1683 JNI_ABORT);
1684 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001685 if (_exception) {
1686 jniThrowException(_env, _exceptionType, _exceptionMessage);
1687 }
Jack Palevich27f80022009-04-15 19:13:17 -07001688}
1689
1690/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1691static void
1692android_glLightxv__IILjava_nio_IntBuffer_2
1693 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001694 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001695 const char * _exceptionType = NULL;
1696 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001697 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001698 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001699 jint _remaining;
1700 GLfixed *params = (GLfixed *) 0;
1701
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001702 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001703 int _needed;
1704 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001705#if defined(GL_SPOT_DIRECTION)
1706 case GL_SPOT_DIRECTION:
1707#endif // defined(GL_SPOT_DIRECTION)
1708 _needed = 3;
1709 break;
1710#if defined(GL_AMBIENT)
1711 case GL_AMBIENT:
1712#endif // defined(GL_AMBIENT)
1713#if defined(GL_DIFFUSE)
1714 case GL_DIFFUSE:
1715#endif // defined(GL_DIFFUSE)
1716#if defined(GL_SPECULAR)
1717 case GL_SPECULAR:
1718#endif // defined(GL_SPECULAR)
1719#if defined(GL_EMISSION)
1720 case GL_EMISSION:
1721#endif // defined(GL_EMISSION)
1722 _needed = 4;
1723 break;
1724 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001725 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001726 break;
1727 }
1728 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001729 _exception = 1;
1730 _exceptionType = "java/lang/IllegalArgumentException";
1731 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001732 goto exit;
1733 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001734 if (params == NULL) {
1735 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1736 params = (GLfixed *) (_paramsBase + _bufferOffset);
1737 }
Jack Palevich27f80022009-04-15 19:13:17 -07001738 glLightxv(
1739 (GLenum)light,
1740 (GLenum)pname,
1741 (GLfixed *)params
1742 );
1743
1744exit:
1745 if (_array) {
1746 releasePointer(_env, _array, params, JNI_FALSE);
1747 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001748 if (_exception) {
1749 jniThrowException(_env, _exceptionType, _exceptionMessage);
1750 }
Jack Palevich27f80022009-04-15 19:13:17 -07001751}
1752
1753/* void glLineWidth ( GLfloat width ) */
1754static void
1755android_glLineWidth__F
1756 (JNIEnv *_env, jobject _this, jfloat width) {
1757 glLineWidth(
1758 (GLfloat)width
1759 );
1760}
1761
1762/* void glLineWidthx ( GLfixed width ) */
1763static void
1764android_glLineWidthx__I
1765 (JNIEnv *_env, jobject _this, jint width) {
1766 glLineWidthx(
1767 (GLfixed)width
1768 );
1769}
1770
1771/* void glLoadIdentity ( void ) */
1772static void
1773android_glLoadIdentity__
1774 (JNIEnv *_env, jobject _this) {
1775 glLoadIdentity();
1776}
1777
1778/* void glLoadMatrixf ( const GLfloat *m ) */
1779static void
1780android_glLoadMatrixf___3FI
1781 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001782 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001783 const char * _exceptionType = NULL;
1784 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001785 GLfloat *m_base = (GLfloat *) 0;
1786 jint _remaining;
1787 GLfloat *m = (GLfloat *) 0;
1788
1789 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001790 _exception = 1;
1791 _exceptionType = "java/lang/IllegalArgumentException";
1792 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001793 goto exit;
1794 }
1795 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001796 _exception = 1;
1797 _exceptionType = "java/lang/IllegalArgumentException";
1798 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001799 goto exit;
1800 }
1801 _remaining = _env->GetArrayLength(m_ref) - offset;
1802 m_base = (GLfloat *)
1803 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
1804 m = m_base + offset;
1805
1806 glLoadMatrixf(
1807 (GLfloat *)m
1808 );
1809
1810exit:
1811 if (m_base) {
1812 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
1813 JNI_ABORT);
1814 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001815 if (_exception) {
1816 jniThrowException(_env, _exceptionType, _exceptionMessage);
1817 }
Jack Palevich27f80022009-04-15 19:13:17 -07001818}
1819
1820/* void glLoadMatrixf ( const GLfloat *m ) */
1821static void
1822android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
1823 (JNIEnv *_env, jobject _this, jobject m_buf) {
1824 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001825 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001826 jint _remaining;
1827 GLfloat *m = (GLfloat *) 0;
1828
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001829 m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
1830 if (m == NULL) {
1831 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1832 m = (GLfloat *) (_mBase + _bufferOffset);
1833 }
Jack Palevich27f80022009-04-15 19:13:17 -07001834 glLoadMatrixf(
1835 (GLfloat *)m
1836 );
1837 if (_array) {
1838 releasePointer(_env, _array, m, JNI_FALSE);
1839 }
1840}
1841
1842/* void glLoadMatrixx ( const GLfixed *m ) */
1843static void
1844android_glLoadMatrixx___3II
1845 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001846 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001847 const char * _exceptionType = NULL;
1848 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001849 GLfixed *m_base = (GLfixed *) 0;
1850 jint _remaining;
1851 GLfixed *m = (GLfixed *) 0;
1852
1853 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001854 _exception = 1;
1855 _exceptionType = "java/lang/IllegalArgumentException";
1856 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001857 goto exit;
1858 }
1859 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001860 _exception = 1;
1861 _exceptionType = "java/lang/IllegalArgumentException";
1862 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001863 goto exit;
1864 }
1865 _remaining = _env->GetArrayLength(m_ref) - offset;
1866 m_base = (GLfixed *)
1867 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
1868 m = m_base + offset;
1869
1870 glLoadMatrixx(
1871 (GLfixed *)m
1872 );
1873
1874exit:
1875 if (m_base) {
1876 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
1877 JNI_ABORT);
1878 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001879 if (_exception) {
1880 jniThrowException(_env, _exceptionType, _exceptionMessage);
1881 }
Jack Palevich27f80022009-04-15 19:13:17 -07001882}
1883
1884/* void glLoadMatrixx ( const GLfixed *m ) */
1885static void
1886android_glLoadMatrixx__Ljava_nio_IntBuffer_2
1887 (JNIEnv *_env, jobject _this, jobject m_buf) {
1888 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001889 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001890 jint _remaining;
1891 GLfixed *m = (GLfixed *) 0;
1892
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001893 m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
1894 if (m == NULL) {
1895 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1896 m = (GLfixed *) (_mBase + _bufferOffset);
1897 }
Jack Palevich27f80022009-04-15 19:13:17 -07001898 glLoadMatrixx(
1899 (GLfixed *)m
1900 );
1901 if (_array) {
1902 releasePointer(_env, _array, m, JNI_FALSE);
1903 }
1904}
1905
1906/* void glLogicOp ( GLenum opcode ) */
1907static void
1908android_glLogicOp__I
1909 (JNIEnv *_env, jobject _this, jint opcode) {
1910 glLogicOp(
1911 (GLenum)opcode
1912 );
1913}
1914
1915/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
1916static void
1917android_glMaterialf__IIF
1918 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
1919 glMaterialf(
1920 (GLenum)face,
1921 (GLenum)pname,
1922 (GLfloat)param
1923 );
1924}
1925
1926/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
1927static void
1928android_glMaterialfv__II_3FI
1929 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001930 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08001931 const char * _exceptionType = NULL;
1932 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001933 GLfloat *params_base = (GLfloat *) 0;
1934 jint _remaining;
1935 GLfloat *params = (GLfloat *) 0;
1936
1937 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001938 _exception = 1;
1939 _exceptionType = "java/lang/IllegalArgumentException";
1940 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001941 goto exit;
1942 }
1943 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001944 _exception = 1;
1945 _exceptionType = "java/lang/IllegalArgumentException";
1946 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001947 goto exit;
1948 }
1949 _remaining = _env->GetArrayLength(params_ref) - offset;
1950 int _needed;
1951 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001952#if defined(GL_AMBIENT)
1953 case GL_AMBIENT:
1954#endif // defined(GL_AMBIENT)
1955#if defined(GL_DIFFUSE)
1956 case GL_DIFFUSE:
1957#endif // defined(GL_DIFFUSE)
1958#if defined(GL_SPECULAR)
1959 case GL_SPECULAR:
1960#endif // defined(GL_SPECULAR)
1961#if defined(GL_EMISSION)
1962 case GL_EMISSION:
1963#endif // defined(GL_EMISSION)
1964#if defined(GL_AMBIENT_AND_DIFFUSE)
1965 case GL_AMBIENT_AND_DIFFUSE:
1966#endif // defined(GL_AMBIENT_AND_DIFFUSE)
1967 _needed = 4;
1968 break;
1969 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08001970 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001971 break;
1972 }
1973 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001974 _exception = 1;
1975 _exceptionType = "java/lang/IllegalArgumentException";
1976 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001977 goto exit;
1978 }
1979 params_base = (GLfloat *)
1980 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1981 params = params_base + offset;
1982
1983 glMaterialfv(
1984 (GLenum)face,
1985 (GLenum)pname,
1986 (GLfloat *)params
1987 );
1988
1989exit:
1990 if (params_base) {
1991 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1992 JNI_ABORT);
1993 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001994 if (_exception) {
1995 jniThrowException(_env, _exceptionType, _exceptionMessage);
1996 }
Jack Palevich27f80022009-04-15 19:13:17 -07001997}
1998
1999/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2000static void
2001android_glMaterialfv__IILjava_nio_FloatBuffer_2
2002 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002003 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002004 const char * _exceptionType = NULL;
2005 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002006 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002007 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002008 jint _remaining;
2009 GLfloat *params = (GLfloat *) 0;
2010
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002011 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002012 int _needed;
2013 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002014#if defined(GL_AMBIENT)
2015 case GL_AMBIENT:
2016#endif // defined(GL_AMBIENT)
2017#if defined(GL_DIFFUSE)
2018 case GL_DIFFUSE:
2019#endif // defined(GL_DIFFUSE)
2020#if defined(GL_SPECULAR)
2021 case GL_SPECULAR:
2022#endif // defined(GL_SPECULAR)
2023#if defined(GL_EMISSION)
2024 case GL_EMISSION:
2025#endif // defined(GL_EMISSION)
2026#if defined(GL_AMBIENT_AND_DIFFUSE)
2027 case GL_AMBIENT_AND_DIFFUSE:
2028#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2029 _needed = 4;
2030 break;
2031 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002032 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002033 break;
2034 }
2035 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002036 _exception = 1;
2037 _exceptionType = "java/lang/IllegalArgumentException";
2038 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002039 goto exit;
2040 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002041 if (params == NULL) {
2042 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2043 params = (GLfloat *) (_paramsBase + _bufferOffset);
2044 }
Jack Palevich27f80022009-04-15 19:13:17 -07002045 glMaterialfv(
2046 (GLenum)face,
2047 (GLenum)pname,
2048 (GLfloat *)params
2049 );
2050
2051exit:
2052 if (_array) {
2053 releasePointer(_env, _array, params, JNI_FALSE);
2054 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002055 if (_exception) {
2056 jniThrowException(_env, _exceptionType, _exceptionMessage);
2057 }
Jack Palevich27f80022009-04-15 19:13:17 -07002058}
2059
2060/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
2061static void
2062android_glMaterialx__III
2063 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
2064 glMaterialx(
2065 (GLenum)face,
2066 (GLenum)pname,
2067 (GLfixed)param
2068 );
2069}
2070
2071/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2072static void
2073android_glMaterialxv__II_3II
2074 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002075 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002076 const char * _exceptionType = NULL;
2077 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002078 GLfixed *params_base = (GLfixed *) 0;
2079 jint _remaining;
2080 GLfixed *params = (GLfixed *) 0;
2081
2082 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002083 _exception = 1;
2084 _exceptionType = "java/lang/IllegalArgumentException";
2085 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002086 goto exit;
2087 }
2088 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002089 _exception = 1;
2090 _exceptionType = "java/lang/IllegalArgumentException";
2091 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002092 goto exit;
2093 }
2094 _remaining = _env->GetArrayLength(params_ref) - offset;
2095 int _needed;
2096 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002097#if defined(GL_AMBIENT)
2098 case GL_AMBIENT:
2099#endif // defined(GL_AMBIENT)
2100#if defined(GL_DIFFUSE)
2101 case GL_DIFFUSE:
2102#endif // defined(GL_DIFFUSE)
2103#if defined(GL_SPECULAR)
2104 case GL_SPECULAR:
2105#endif // defined(GL_SPECULAR)
2106#if defined(GL_EMISSION)
2107 case GL_EMISSION:
2108#endif // defined(GL_EMISSION)
2109#if defined(GL_AMBIENT_AND_DIFFUSE)
2110 case GL_AMBIENT_AND_DIFFUSE:
2111#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2112 _needed = 4;
2113 break;
2114 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002115 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002116 break;
2117 }
2118 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002119 _exception = 1;
2120 _exceptionType = "java/lang/IllegalArgumentException";
2121 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002122 goto exit;
2123 }
2124 params_base = (GLfixed *)
2125 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2126 params = params_base + offset;
2127
2128 glMaterialxv(
2129 (GLenum)face,
2130 (GLenum)pname,
2131 (GLfixed *)params
2132 );
2133
2134exit:
2135 if (params_base) {
2136 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2137 JNI_ABORT);
2138 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002139 if (_exception) {
2140 jniThrowException(_env, _exceptionType, _exceptionMessage);
2141 }
Jack Palevich27f80022009-04-15 19:13:17 -07002142}
2143
2144/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2145static void
2146android_glMaterialxv__IILjava_nio_IntBuffer_2
2147 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002148 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002149 const char * _exceptionType = NULL;
2150 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002151 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002152 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002153 jint _remaining;
2154 GLfixed *params = (GLfixed *) 0;
2155
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002156 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002157 int _needed;
2158 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002159#if defined(GL_AMBIENT)
2160 case GL_AMBIENT:
2161#endif // defined(GL_AMBIENT)
2162#if defined(GL_DIFFUSE)
2163 case GL_DIFFUSE:
2164#endif // defined(GL_DIFFUSE)
2165#if defined(GL_SPECULAR)
2166 case GL_SPECULAR:
2167#endif // defined(GL_SPECULAR)
2168#if defined(GL_EMISSION)
2169 case GL_EMISSION:
2170#endif // defined(GL_EMISSION)
2171#if defined(GL_AMBIENT_AND_DIFFUSE)
2172 case GL_AMBIENT_AND_DIFFUSE:
2173#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2174 _needed = 4;
2175 break;
2176 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002177 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002178 break;
2179 }
2180 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002181 _exception = 1;
2182 _exceptionType = "java/lang/IllegalArgumentException";
2183 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002184 goto exit;
2185 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002186 if (params == NULL) {
2187 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2188 params = (GLfixed *) (_paramsBase + _bufferOffset);
2189 }
Jack Palevich27f80022009-04-15 19:13:17 -07002190 glMaterialxv(
2191 (GLenum)face,
2192 (GLenum)pname,
2193 (GLfixed *)params
2194 );
2195
2196exit:
2197 if (_array) {
2198 releasePointer(_env, _array, params, JNI_FALSE);
2199 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002200 if (_exception) {
2201 jniThrowException(_env, _exceptionType, _exceptionMessage);
2202 }
Jack Palevich27f80022009-04-15 19:13:17 -07002203}
2204
2205/* void glMatrixMode ( GLenum mode ) */
2206static void
2207android_glMatrixMode__I
2208 (JNIEnv *_env, jobject _this, jint mode) {
2209 glMatrixMode(
2210 (GLenum)mode
2211 );
2212}
2213
2214/* void glMultMatrixf ( const GLfloat *m ) */
2215static void
2216android_glMultMatrixf___3FI
2217 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002218 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002219 const char * _exceptionType = NULL;
2220 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002221 GLfloat *m_base = (GLfloat *) 0;
2222 jint _remaining;
2223 GLfloat *m = (GLfloat *) 0;
2224
2225 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002226 _exception = 1;
2227 _exceptionType = "java/lang/IllegalArgumentException";
2228 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002229 goto exit;
2230 }
2231 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002232 _exception = 1;
2233 _exceptionType = "java/lang/IllegalArgumentException";
2234 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002235 goto exit;
2236 }
2237 _remaining = _env->GetArrayLength(m_ref) - offset;
2238 m_base = (GLfloat *)
2239 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
2240 m = m_base + offset;
2241
2242 glMultMatrixf(
2243 (GLfloat *)m
2244 );
2245
2246exit:
2247 if (m_base) {
2248 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
2249 JNI_ABORT);
2250 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002251 if (_exception) {
2252 jniThrowException(_env, _exceptionType, _exceptionMessage);
2253 }
Jack Palevich27f80022009-04-15 19:13:17 -07002254}
2255
2256/* void glMultMatrixf ( const GLfloat *m ) */
2257static void
2258android_glMultMatrixf__Ljava_nio_FloatBuffer_2
2259 (JNIEnv *_env, jobject _this, jobject m_buf) {
2260 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002261 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002262 jint _remaining;
2263 GLfloat *m = (GLfloat *) 0;
2264
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002265 m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
2266 if (m == NULL) {
2267 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2268 m = (GLfloat *) (_mBase + _bufferOffset);
2269 }
Jack Palevich27f80022009-04-15 19:13:17 -07002270 glMultMatrixf(
2271 (GLfloat *)m
2272 );
2273 if (_array) {
2274 releasePointer(_env, _array, m, JNI_FALSE);
2275 }
2276}
2277
2278/* void glMultMatrixx ( const GLfixed *m ) */
2279static void
2280android_glMultMatrixx___3II
2281 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002282 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002283 const char * _exceptionType = NULL;
2284 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002285 GLfixed *m_base = (GLfixed *) 0;
2286 jint _remaining;
2287 GLfixed *m = (GLfixed *) 0;
2288
2289 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002290 _exception = 1;
2291 _exceptionType = "java/lang/IllegalArgumentException";
2292 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002293 goto exit;
2294 }
2295 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002296 _exception = 1;
2297 _exceptionType = "java/lang/IllegalArgumentException";
2298 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002299 goto exit;
2300 }
2301 _remaining = _env->GetArrayLength(m_ref) - offset;
2302 m_base = (GLfixed *)
2303 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
2304 m = m_base + offset;
2305
2306 glMultMatrixx(
2307 (GLfixed *)m
2308 );
2309
2310exit:
2311 if (m_base) {
2312 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
2313 JNI_ABORT);
2314 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002315 if (_exception) {
2316 jniThrowException(_env, _exceptionType, _exceptionMessage);
2317 }
Jack Palevich27f80022009-04-15 19:13:17 -07002318}
2319
2320/* void glMultMatrixx ( const GLfixed *m ) */
2321static void
2322android_glMultMatrixx__Ljava_nio_IntBuffer_2
2323 (JNIEnv *_env, jobject _this, jobject m_buf) {
2324 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002325 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002326 jint _remaining;
2327 GLfixed *m = (GLfixed *) 0;
2328
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002329 m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
2330 if (m == NULL) {
2331 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2332 m = (GLfixed *) (_mBase + _bufferOffset);
2333 }
Jack Palevich27f80022009-04-15 19:13:17 -07002334 glMultMatrixx(
2335 (GLfixed *)m
2336 );
2337 if (_array) {
2338 releasePointer(_env, _array, m, JNI_FALSE);
2339 }
2340}
2341
2342/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
2343static void
2344android_glMultiTexCoord4f__IFFFF
2345 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
2346 glMultiTexCoord4f(
2347 (GLenum)target,
2348 (GLfloat)s,
2349 (GLfloat)t,
2350 (GLfloat)r,
2351 (GLfloat)q
2352 );
2353}
2354
2355/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
2356static void
2357android_glMultiTexCoord4x__IIIII
2358 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
2359 glMultiTexCoord4x(
2360 (GLenum)target,
2361 (GLfixed)s,
2362 (GLfixed)t,
2363 (GLfixed)r,
2364 (GLfixed)q
2365 );
2366}
2367
2368/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
2369static void
2370android_glNormal3f__FFF
2371 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
2372 glNormal3f(
2373 (GLfloat)nx,
2374 (GLfloat)ny,
2375 (GLfloat)nz
2376 );
2377}
2378
2379/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
2380static void
2381android_glNormal3x__III
2382 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
2383 glNormal3x(
2384 (GLfixed)nx,
2385 (GLfixed)ny,
2386 (GLfixed)nz
2387 );
2388}
2389
2390/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
2391static void
2392android_glNormalPointerBounds__IILjava_nio_Buffer_2I
2393 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
2394 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002395 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002396 jint _remaining;
2397 GLvoid *pointer = (GLvoid *) 0;
2398
Jack Paleviche20ea782009-05-07 18:28:29 -07002399 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07002400 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07002401 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07002402 return;
2403 }
2404 }
Jack Palevich27f80022009-04-15 19:13:17 -07002405 glNormalPointerBounds(
2406 (GLenum)type,
2407 (GLsizei)stride,
2408 (GLvoid *)pointer,
2409 (GLsizei)remaining
2410 );
Jack Palevich27f80022009-04-15 19:13:17 -07002411}
2412
2413/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
2414static void
2415android_glOrthof__FFFFFF
2416 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
2417 glOrthof(
2418 (GLfloat)left,
2419 (GLfloat)right,
2420 (GLfloat)bottom,
2421 (GLfloat)top,
2422 (GLfloat)zNear,
2423 (GLfloat)zFar
2424 );
2425}
2426
2427/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
2428static void
2429android_glOrthox__IIIIII
2430 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
2431 glOrthox(
2432 (GLfixed)left,
2433 (GLfixed)right,
2434 (GLfixed)bottom,
2435 (GLfixed)top,
2436 (GLfixed)zNear,
2437 (GLfixed)zFar
2438 );
2439}
2440
2441/* void glPixelStorei ( GLenum pname, GLint param ) */
2442static void
2443android_glPixelStorei__II
2444 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2445 glPixelStorei(
2446 (GLenum)pname,
2447 (GLint)param
2448 );
2449}
2450
2451/* void glPointSize ( GLfloat size ) */
2452static void
2453android_glPointSize__F
2454 (JNIEnv *_env, jobject _this, jfloat size) {
2455 glPointSize(
2456 (GLfloat)size
2457 );
2458}
2459
2460/* void glPointSizex ( GLfixed size ) */
2461static void
2462android_glPointSizex__I
2463 (JNIEnv *_env, jobject _this, jint size) {
2464 glPointSizex(
2465 (GLfixed)size
2466 );
2467}
2468
2469/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
2470static void
2471android_glPolygonOffset__FF
2472 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
2473 glPolygonOffset(
2474 (GLfloat)factor,
2475 (GLfloat)units
2476 );
2477}
2478
2479/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
2480static void
2481android_glPolygonOffsetx__II
2482 (JNIEnv *_env, jobject _this, jint factor, jint units) {
2483 glPolygonOffsetx(
2484 (GLfixed)factor,
2485 (GLfixed)units
2486 );
2487}
2488
2489/* void glPopMatrix ( void ) */
2490static void
2491android_glPopMatrix__
2492 (JNIEnv *_env, jobject _this) {
2493 glPopMatrix();
2494}
2495
2496/* void glPushMatrix ( void ) */
2497static void
2498android_glPushMatrix__
2499 (JNIEnv *_env, jobject _this) {
2500 glPushMatrix();
2501}
2502
2503/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
2504static void
2505android_glReadPixels__IIIIIILjava_nio_Buffer_2
2506 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
Jack Palevich27f80022009-04-15 19:13:17 -07002507 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002508 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002509 jint _remaining;
2510 GLvoid *pixels = (GLvoid *) 0;
2511
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002512 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
2513 if (pixels == NULL) {
2514 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2515 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
2516 }
Jack Palevich27f80022009-04-15 19:13:17 -07002517 glReadPixels(
2518 (GLint)x,
2519 (GLint)y,
2520 (GLsizei)width,
2521 (GLsizei)height,
2522 (GLenum)format,
2523 (GLenum)type,
2524 (GLvoid *)pixels
2525 );
2526 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002527 releasePointer(_env, _array, pixels, JNI_TRUE);
Jack Palevich27f80022009-04-15 19:13:17 -07002528 }
2529}
2530
2531/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
2532static void
2533android_glRotatef__FFFF
2534 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
2535 glRotatef(
2536 (GLfloat)angle,
2537 (GLfloat)x,
2538 (GLfloat)y,
2539 (GLfloat)z
2540 );
2541}
2542
2543/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
2544static void
2545android_glRotatex__IIII
2546 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
2547 glRotatex(
2548 (GLfixed)angle,
2549 (GLfixed)x,
2550 (GLfixed)y,
2551 (GLfixed)z
2552 );
2553}
2554
2555/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
2556static void
2557android_glSampleCoverage__FZ
2558 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
2559 glSampleCoverage(
2560 (GLclampf)value,
2561 (GLboolean)invert
2562 );
2563}
2564
2565/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
2566static void
2567android_glSampleCoveragex__IZ
2568 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
2569 glSampleCoveragex(
2570 (GLclampx)value,
2571 (GLboolean)invert
2572 );
2573}
2574
2575/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
2576static void
2577android_glScalef__FFF
2578 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
2579 glScalef(
2580 (GLfloat)x,
2581 (GLfloat)y,
2582 (GLfloat)z
2583 );
2584}
2585
2586/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
2587static void
2588android_glScalex__III
2589 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
2590 glScalex(
2591 (GLfixed)x,
2592 (GLfixed)y,
2593 (GLfixed)z
2594 );
2595}
2596
2597/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
2598static void
2599android_glScissor__IIII
2600 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
2601 glScissor(
2602 (GLint)x,
2603 (GLint)y,
2604 (GLsizei)width,
2605 (GLsizei)height
2606 );
2607}
2608
2609/* void glShadeModel ( GLenum mode ) */
2610static void
2611android_glShadeModel__I
2612 (JNIEnv *_env, jobject _this, jint mode) {
2613 glShadeModel(
2614 (GLenum)mode
2615 );
2616}
2617
2618/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
2619static void
2620android_glStencilFunc__III
2621 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
2622 glStencilFunc(
2623 (GLenum)func,
2624 (GLint)ref,
2625 (GLuint)mask
2626 );
2627}
2628
2629/* void glStencilMask ( GLuint mask ) */
2630static void
2631android_glStencilMask__I
2632 (JNIEnv *_env, jobject _this, jint mask) {
2633 glStencilMask(
2634 (GLuint)mask
2635 );
2636}
2637
2638/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
2639static void
2640android_glStencilOp__III
2641 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
2642 glStencilOp(
2643 (GLenum)fail,
2644 (GLenum)zfail,
2645 (GLenum)zpass
2646 );
2647}
2648
2649/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2650static void
2651android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
2652 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
2653 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002654 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002655 jint _remaining;
2656 GLvoid *pointer = (GLvoid *) 0;
2657
Jack Paleviche20ea782009-05-07 18:28:29 -07002658 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07002659 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07002660 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07002661 return;
2662 }
2663 }
Jack Palevich27f80022009-04-15 19:13:17 -07002664 glTexCoordPointerBounds(
2665 (GLint)size,
2666 (GLenum)type,
2667 (GLsizei)stride,
2668 (GLvoid *)pointer,
2669 (GLsizei)remaining
2670 );
Jack Palevich27f80022009-04-15 19:13:17 -07002671}
2672
2673/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
2674static void
2675android_glTexEnvf__IIF
2676 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
2677 glTexEnvf(
2678 (GLenum)target,
2679 (GLenum)pname,
2680 (GLfloat)param
2681 );
2682}
2683
2684/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2685static void
2686android_glTexEnvfv__II_3FI
2687 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002688 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002689 const char * _exceptionType = NULL;
2690 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002691 GLfloat *params_base = (GLfloat *) 0;
2692 jint _remaining;
2693 GLfloat *params = (GLfloat *) 0;
2694
2695 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002696 _exception = 1;
2697 _exceptionType = "java/lang/IllegalArgumentException";
2698 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002699 goto exit;
2700 }
2701 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002702 _exception = 1;
2703 _exceptionType = "java/lang/IllegalArgumentException";
2704 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002705 goto exit;
2706 }
2707 _remaining = _env->GetArrayLength(params_ref) - offset;
2708 int _needed;
2709 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002710#if defined(GL_TEXTURE_ENV_COLOR)
2711 case GL_TEXTURE_ENV_COLOR:
2712#endif // defined(GL_TEXTURE_ENV_COLOR)
2713 _needed = 4;
2714 break;
2715 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002716 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002717 break;
2718 }
2719 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002720 _exception = 1;
2721 _exceptionType = "java/lang/IllegalArgumentException";
2722 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002723 goto exit;
2724 }
2725 params_base = (GLfloat *)
2726 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2727 params = params_base + offset;
2728
2729 glTexEnvfv(
2730 (GLenum)target,
2731 (GLenum)pname,
2732 (GLfloat *)params
2733 );
2734
2735exit:
2736 if (params_base) {
2737 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2738 JNI_ABORT);
2739 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002740 if (_exception) {
2741 jniThrowException(_env, _exceptionType, _exceptionMessage);
2742 }
Jack Palevich27f80022009-04-15 19:13:17 -07002743}
2744
2745/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2746static void
2747android_glTexEnvfv__IILjava_nio_FloatBuffer_2
2748 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002749 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002750 const char * _exceptionType = NULL;
2751 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002752 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002753 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002754 jint _remaining;
2755 GLfloat *params = (GLfloat *) 0;
2756
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002757 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002758 int _needed;
2759 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002760#if defined(GL_TEXTURE_ENV_COLOR)
2761 case GL_TEXTURE_ENV_COLOR:
2762#endif // defined(GL_TEXTURE_ENV_COLOR)
2763 _needed = 4;
2764 break;
2765 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002766 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002767 break;
2768 }
2769 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002770 _exception = 1;
2771 _exceptionType = "java/lang/IllegalArgumentException";
2772 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002773 goto exit;
2774 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002775 if (params == NULL) {
2776 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2777 params = (GLfloat *) (_paramsBase + _bufferOffset);
2778 }
Jack Palevich27f80022009-04-15 19:13:17 -07002779 glTexEnvfv(
2780 (GLenum)target,
2781 (GLenum)pname,
2782 (GLfloat *)params
2783 );
2784
2785exit:
2786 if (_array) {
2787 releasePointer(_env, _array, params, JNI_FALSE);
2788 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002789 if (_exception) {
2790 jniThrowException(_env, _exceptionType, _exceptionMessage);
2791 }
Jack Palevich27f80022009-04-15 19:13:17 -07002792}
2793
2794/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
2795static void
2796android_glTexEnvx__III
2797 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
2798 glTexEnvx(
2799 (GLenum)target,
2800 (GLenum)pname,
2801 (GLfixed)param
2802 );
2803}
2804
2805/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2806static void
2807android_glTexEnvxv__II_3II
2808 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002809 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002810 const char * _exceptionType = NULL;
2811 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002812 GLfixed *params_base = (GLfixed *) 0;
2813 jint _remaining;
2814 GLfixed *params = (GLfixed *) 0;
2815
2816 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002817 _exception = 1;
2818 _exceptionType = "java/lang/IllegalArgumentException";
2819 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002820 goto exit;
2821 }
2822 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002823 _exception = 1;
2824 _exceptionType = "java/lang/IllegalArgumentException";
2825 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002826 goto exit;
2827 }
2828 _remaining = _env->GetArrayLength(params_ref) - offset;
2829 int _needed;
2830 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002831#if defined(GL_TEXTURE_ENV_COLOR)
2832 case GL_TEXTURE_ENV_COLOR:
2833#endif // defined(GL_TEXTURE_ENV_COLOR)
2834 _needed = 4;
2835 break;
2836 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002837 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002838 break;
2839 }
2840 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002841 _exception = 1;
2842 _exceptionType = "java/lang/IllegalArgumentException";
2843 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002844 goto exit;
2845 }
2846 params_base = (GLfixed *)
2847 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2848 params = params_base + offset;
2849
2850 glTexEnvxv(
2851 (GLenum)target,
2852 (GLenum)pname,
2853 (GLfixed *)params
2854 );
2855
2856exit:
2857 if (params_base) {
2858 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2859 JNI_ABORT);
2860 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002861 if (_exception) {
2862 jniThrowException(_env, _exceptionType, _exceptionMessage);
2863 }
Jack Palevich27f80022009-04-15 19:13:17 -07002864}
2865
2866/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2867static void
2868android_glTexEnvxv__IILjava_nio_IntBuffer_2
2869 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002870 jint _exception = 0;
Mathias Agopian15284de2013-02-23 03:12:30 -08002871 const char * _exceptionType = NULL;
2872 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002873 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002874 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002875 jint _remaining;
2876 GLfixed *params = (GLfixed *) 0;
2877
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002878 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002879 int _needed;
2880 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002881#if defined(GL_TEXTURE_ENV_COLOR)
2882 case GL_TEXTURE_ENV_COLOR:
2883#endif // defined(GL_TEXTURE_ENV_COLOR)
2884 _needed = 4;
2885 break;
2886 default:
Mathias Agopian15284de2013-02-23 03:12:30 -08002887 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002888 break;
2889 }
2890 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002891 _exception = 1;
2892 _exceptionType = "java/lang/IllegalArgumentException";
2893 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002894 goto exit;
2895 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002896 if (params == NULL) {
2897 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2898 params = (GLfixed *) (_paramsBase + _bufferOffset);
2899 }
Jack Palevich27f80022009-04-15 19:13:17 -07002900 glTexEnvxv(
2901 (GLenum)target,
2902 (GLenum)pname,
2903 (GLfixed *)params
2904 );
2905
2906exit:
2907 if (_array) {
2908 releasePointer(_env, _array, params, JNI_FALSE);
2909 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002910 if (_exception) {
2911 jniThrowException(_env, _exceptionType, _exceptionMessage);
2912 }
Jack Palevich27f80022009-04-15 19:13:17 -07002913}
2914
2915/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
2916static void
2917android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
2918 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
2919 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002920 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002921 jint _remaining;
2922 GLvoid *pixels = (GLvoid *) 0;
2923
2924 if (pixels_buf) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002925 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
2926 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07002927 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002928 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2929 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002930 }
2931 glTexImage2D(
2932 (GLenum)target,
2933 (GLint)level,
2934 (GLint)internalformat,
2935 (GLsizei)width,
2936 (GLsizei)height,
2937 (GLint)border,
2938 (GLenum)format,
2939 (GLenum)type,
2940 (GLvoid *)pixels
2941 );
2942 if (_array) {
2943 releasePointer(_env, _array, pixels, JNI_FALSE);
2944 }
2945}
2946
2947/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
2948static void
2949android_glTexParameterf__IIF
2950 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
2951 glTexParameterf(
2952 (GLenum)target,
2953 (GLenum)pname,
2954 (GLfloat)param
2955 );
2956}
2957
2958/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
2959static void
2960android_glTexParameterx__III
2961 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
2962 glTexParameterx(
2963 (GLenum)target,
2964 (GLenum)pname,
2965 (GLfixed)param
2966 );
2967}
2968
2969/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
2970static void
2971android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
2972 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
2973 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002974 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002975 jint _remaining;
2976 GLvoid *pixels = (GLvoid *) 0;
2977
2978 if (pixels_buf) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002979 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
2980 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07002981 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002982 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2983 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002984 }
2985 glTexSubImage2D(
2986 (GLenum)target,
2987 (GLint)level,
2988 (GLint)xoffset,
2989 (GLint)yoffset,
2990 (GLsizei)width,
2991 (GLsizei)height,
2992 (GLenum)format,
2993 (GLenum)type,
2994 (GLvoid *)pixels
2995 );
2996 if (_array) {
2997 releasePointer(_env, _array, pixels, JNI_FALSE);
2998 }
2999}
3000
3001/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
3002static void
3003android_glTranslatef__FFF
3004 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3005 glTranslatef(
3006 (GLfloat)x,
3007 (GLfloat)y,
3008 (GLfloat)z
3009 );
3010}
3011
3012/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
3013static void
3014android_glTranslatex__III
3015 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3016 glTranslatex(
3017 (GLfixed)x,
3018 (GLfixed)y,
3019 (GLfixed)z
3020 );
3021}
3022
3023/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3024static void
3025android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
3026 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3027 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003028 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003029 jint _remaining;
3030 GLvoid *pointer = (GLvoid *) 0;
3031
Jack Paleviche20ea782009-05-07 18:28:29 -07003032 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003033 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003034 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003035 return;
3036 }
3037 }
Jack Palevich27f80022009-04-15 19:13:17 -07003038 glVertexPointerBounds(
3039 (GLint)size,
3040 (GLenum)type,
3041 (GLsizei)stride,
3042 (GLvoid *)pointer,
3043 (GLsizei)remaining
3044 );
Jack Palevich27f80022009-04-15 19:13:17 -07003045}
3046
3047/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3048static void
3049android_glViewport__IIII
3050 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3051 glViewport(
3052 (GLint)x,
3053 (GLint)y,
3054 (GLsizei)width,
3055 (GLsizei)height
3056 );
3057}
3058
3059static const char *classPathName = "android/opengl/GLES10";
3060
3061static JNINativeMethod methods[] = {
3062{"_nativeClassInit", "()V", (void*)nativeClassInit },
3063{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
3064{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
3065{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
3066{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
3067{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
3068{"glClear", "(I)V", (void *) android_glClear__I },
3069{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
3070{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
3071{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
3072{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
3073{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
3074{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
3075{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
3076{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
3077{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
3078{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
3079{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
3080{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3081{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
3082{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
3083{"glCullFace", "(I)V", (void *) android_glCullFace__I },
3084{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
3085{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
3086{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
3087{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
3088{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
3089{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
3090{"glDisable", "(I)V", (void *) android_glDisable__I },
3091{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
3092{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
3093{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
3094{"glEnable", "(I)V", (void *) android_glEnable__I },
3095{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
3096{"glFinish", "()V", (void *) android_glFinish__ },
3097{"glFlush", "()V", (void *) android_glFlush__ },
3098{"glFogf", "(IF)V", (void *) android_glFogf__IF },
3099{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
3100{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
3101{"glFogx", "(II)V", (void *) android_glFogx__II },
3102{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
3103{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
3104{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
3105{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
3106{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
3107{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
3108{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
3109{"glGetError", "()I", (void *) android_glGetError__ },
3110{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
3111{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
Jack Palevicha3795852009-04-24 10:35:11 -07003112{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
Jack Palevich27f80022009-04-15 19:13:17 -07003113{"glHint", "(II)V", (void *) android_glHint__II },
3114{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
3115{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
3116{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
3117{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
3118{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
3119{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
3120{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
3121{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
3122{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
3123{"glLightx", "(III)V", (void *) android_glLightx__III },
3124{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
3125{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
3126{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
3127{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
3128{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
3129{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
3130{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
3131{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
3132{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
3133{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
3134{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
3135{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
3136{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
3137{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
3138{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
3139{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
3140{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
3141{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
3142{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
3143{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
3144{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
3145{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
3146{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
3147{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
3148{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
3149{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
3150{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
3151{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
3152{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
3153{"glPointSize", "(F)V", (void *) android_glPointSize__F },
3154{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
3155{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
3156{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
3157{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
3158{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
3159{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
3160{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
3161{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
3162{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
3163{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
3164{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
3165{"glScalex", "(III)V", (void *) android_glScalex__III },
3166{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
3167{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
3168{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
3169{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
3170{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
3171{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
3172{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
3173{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
3174{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
3175{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
3176{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
3177{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
3178{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
3179{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
3180{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
3181{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3182{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
3183{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
3184{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
3185{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
3186};
3187
3188int register_android_opengl_jni_GLES10(JNIEnv *_env)
3189{
3190 int err;
3191 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
3192 return err;
3193}