blob: c9b68bfe661a484e5c68a4e5ba6fe3e0f52a4d28 [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
Andreas Gampebfe63332014-11-12 14:12:45 -080020#pragma GCC diagnostic ignored "-Wunused-variable"
21#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
22#pragma GCC diagnostic ignored "-Wunused-function"
23
Mathias Agopian2ad04772013-02-23 03:12:30 -080024#include <GLES/gl.h>
25#include <GLES/glext.h>
26
Jesse Hall9626f822014-05-19 20:57:49 -070027#include <jni.h>
28#include <JNIHelp.h>
Jack Palevich27f80022009-04-15 19:13:17 -070029#include <android_runtime/AndroidRuntime.h>
30#include <utils/misc.h>
Jack Palevich27f80022009-04-15 19:13:17 -070031#include <assert.h>
Mathias Agopian8331f722009-05-08 15:35:17 -070032
Jack Palevich27f80022009-04-15 19:13:17 -070033static int initialized = 0;
34
35static jclass nioAccessClass;
36static jclass bufferClass;
Jack Palevich27f80022009-04-15 19:13:17 -070037static jmethodID getBasePointerID;
38static jmethodID getBaseArrayID;
39static jmethodID getBaseArrayOffsetID;
40static jfieldID positionID;
41static jfieldID limitID;
42static jfieldID elementSizeShiftID;
43
Mathias Agopian2ad04772013-02-23 03:12:30 -080044
45/* special calls implemented in Android's GLES wrapper used to more
46 * efficiently bound-check passed arrays */
47extern "C" {
48#ifdef GL_VERSION_ES_CM_1_1
49GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
50 const GLvoid *ptr, GLsizei count);
51GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
52 const GLvoid *pointer, GLsizei count);
53GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
54 GLsizei stride, const GLvoid *pointer, GLsizei count);
55GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
56 GLsizei stride, const GLvoid *pointer, GLsizei count);
57GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
58 GLsizei stride, const GLvoid *pointer, GLsizei count);
59GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count);
61GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
62 GLsizei stride, const GLvoid *pointer, GLsizei count);
63#endif
64#ifdef GL_ES_VERSION_2_0
65static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
66 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
67 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
68}
69#endif
Andy McFaddencee51982013-04-25 16:08:31 -070070#ifdef GL_ES_VERSION_3_0
71static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
72 GLsizei stride, const GLvoid *pointer, GLsizei count) {
73 glVertexAttribIPointer(indx, size, type, stride, pointer);
74}
75#endif
Mathias Agopian2ad04772013-02-23 03:12:30 -080076}
77
Jack Palevich27f80022009-04-15 19:13:17 -070078/* Cache method IDs each time the class is loaded. */
79
80static void
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070081nativeClassInit(JNIEnv *_env, jclass glImplClass)
Jack Palevich27f80022009-04-15 19:13:17 -070082{
83 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
84 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
85
86 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
87 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
88
89 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
90 "getBasePointer", "(Ljava/nio/Buffer;)J");
91 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
92 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
93 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
94 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
95
96 positionID = _env->GetFieldID(bufferClass, "position", "I");
97 limitID = _env->GetFieldID(bufferClass, "limit", "I");
98 elementSizeShiftID =
99 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
100}
101
Jack Palevich27f80022009-04-15 19:13:17 -0700102static void *
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700103getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
Jack Palevich27f80022009-04-15 19:13:17 -0700104{
105 jint position;
106 jint limit;
107 jint elementSizeShift;
108 jlong pointer;
Jack Palevich27f80022009-04-15 19:13:17 -0700109
110 position = _env->GetIntField(buffer, positionID);
111 limit = _env->GetIntField(buffer, limitID);
112 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
113 *remaining = (limit - position) << elementSizeShift;
114 pointer = _env->CallStaticLongMethod(nioAccessClass,
115 getBasePointerID, buffer);
116 if (pointer != 0L) {
117 *array = NULL;
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000118 return reinterpret_cast<void*>(pointer);
Jack Palevich27f80022009-04-15 19:13:17 -0700119 }
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700120
Jack Palevich27f80022009-04-15 19:13:17 -0700121 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
122 getBaseArrayID, buffer);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700123 *offset = _env->CallStaticIntMethod(nioAccessClass,
Jack Palevich27f80022009-04-15 19:13:17 -0700124 getBaseArrayOffsetID, buffer);
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700125
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700126 return NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700127}
128
Jack Palevich27f80022009-04-15 19:13:17 -0700129static void
130releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
131{
132 _env->ReleasePrimitiveArrayCritical(array, data,
Mathias Agopian2ad04772013-02-23 03:12:30 -0800133 commit ? 0 : JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -0700134}
135
Jack Palevich16e79722009-05-15 18:13:34 -0700136static void *
137getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
138 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
139 if (buf) {
140 jint position = _env->GetIntField(buffer, positionID);
141 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
142 buf += position << elementSizeShift;
143 } else {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700144 jniThrowException(_env, "java/lang/IllegalArgumentException",
145 "Must use a native order direct Buffer");
Jack Palevich16e79722009-05-15 18:13:34 -0700146 }
147 return (void*) buf;
148}
149
Mathias Agopian2ad04772013-02-23 03:12:30 -0800150// --------------------------------------------------------------------------
151
152/*
153 * returns the number of values glGet returns for a given pname.
154 *
155 * The code below is written such that pnames requiring only one values
156 * are the default (and are not explicitely tested for). This makes the
157 * checking code much shorter/readable/efficient.
158 *
159 * This means that unknown pnames (e.g.: extensions) will default to 1. If
160 * that unknown pname needs more than 1 value, then the validation check
161 * is incomplete and the app may crash if it passed the wrong number params.
162 */
163static int getNeededCount(GLint pname) {
164 int needed = 1;
165#ifdef GL_ES_VERSION_2_0
166 // GLES 2.x pnames
167 switch (pname) {
168 case GL_ALIASED_LINE_WIDTH_RANGE:
169 case GL_ALIASED_POINT_SIZE_RANGE:
170 needed = 2;
171 break;
172
173 case GL_BLEND_COLOR:
174 case GL_COLOR_CLEAR_VALUE:
175 case GL_COLOR_WRITEMASK:
176 case GL_SCISSOR_BOX:
177 case GL_VIEWPORT:
178 needed = 4;
179 break;
180
181 case GL_COMPRESSED_TEXTURE_FORMATS:
182 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
183 break;
184
185 case GL_SHADER_BINARY_FORMATS:
186 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
187 break;
188 }
189#endif
190
191#ifdef GL_VERSION_ES_CM_1_1
192 // GLES 1.x pnames
193 switch (pname) {
194 case GL_ALIASED_LINE_WIDTH_RANGE:
195 case GL_ALIASED_POINT_SIZE_RANGE:
196 case GL_DEPTH_RANGE:
197 case GL_SMOOTH_LINE_WIDTH_RANGE:
198 case GL_SMOOTH_POINT_SIZE_RANGE:
199 needed = 2;
200 break;
201
202 case GL_CURRENT_NORMAL:
203 case GL_POINT_DISTANCE_ATTENUATION:
204 needed = 3;
205 break;
206
207 case GL_COLOR_CLEAR_VALUE:
208 case GL_COLOR_WRITEMASK:
209 case GL_CURRENT_COLOR:
210 case GL_CURRENT_TEXTURE_COORDS:
211 case GL_FOG_COLOR:
212 case GL_LIGHT_MODEL_AMBIENT:
213 case GL_SCISSOR_BOX:
214 case GL_VIEWPORT:
215 needed = 4;
216 break;
217
218 case GL_MODELVIEW_MATRIX:
219 case GL_PROJECTION_MATRIX:
220 case GL_TEXTURE_MATRIX:
221 needed = 16;
222 break;
223
224 case GL_COMPRESSED_TEXTURE_FORMATS:
225 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
226 break;
227 }
228#endif
229 return needed;
230}
231
232template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)>
233static void
234get
235 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
236 jint _exception = 0;
237 const char * _exceptionType;
238 const char * _exceptionMessage;
239 CTYPE *params_base = (CTYPE *) 0;
240 jint _remaining;
241 CTYPE *params = (CTYPE *) 0;
242 int _needed = 0;
243
244 if (!params_ref) {
245 _exception = 1;
246 _exceptionType = "java/lang/IllegalArgumentException";
247 _exceptionMessage = "params == null";
248 goto exit;
249 }
250 if (offset < 0) {
251 _exception = 1;
252 _exceptionType = "java/lang/IllegalArgumentException";
253 _exceptionMessage = "offset < 0";
254 goto exit;
255 }
256 _remaining = _env->GetArrayLength(params_ref) - offset;
257 _needed = getNeededCount(pname);
258 // if we didn't find this pname, we just assume the user passed
259 // an array of the right size -- this might happen with extensions
260 // or if we forget an enum here.
261 if (_remaining < _needed) {
262 _exception = 1;
263 _exceptionType = "java/lang/IllegalArgumentException";
264 _exceptionMessage = "length - offset < needed";
265 goto exit;
266 }
267 params_base = (CTYPE *)
268 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
269 params = params_base + offset;
270
271 GET(
272 (GLenum)pname,
273 (CTYPE *)params
274 );
275
276exit:
277 if (params_base) {
278 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
279 _exception ? JNI_ABORT: 0);
280 }
281 if (_exception) {
282 jniThrowException(_env, _exceptionType, _exceptionMessage);
283 }
284}
285
286
287template <typename CTYPE, void GET(GLenum, CTYPE*)>
288static void
289getarray
290 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
291 jint _exception = 0;
292 const char * _exceptionType;
293 const char * _exceptionMessage;
294 jarray _array = (jarray) 0;
295 jint _bufferOffset = (jint) 0;
296 jint _remaining;
297 CTYPE *params = (CTYPE *) 0;
298 int _needed = 0;
299
300 params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Andy McFaddencee51982013-04-25 16:08:31 -0700301 _remaining /= sizeof(CTYPE); // convert from bytes to item count
Mathias Agopian2ad04772013-02-23 03:12:30 -0800302 _needed = getNeededCount(pname);
303 // if we didn't find this pname, we just assume the user passed
304 // an array of the right size -- this might happen with extensions
305 // or if we forget an enum here.
306 if (_needed>0 && _remaining < _needed) {
307 _exception = 1;
308 _exceptionType = "java/lang/IllegalArgumentException";
309 _exceptionMessage = "remaining() < needed";
310 goto exit;
311 }
312 if (params == NULL) {
313 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
314 params = (CTYPE *) (_paramsBase + _bufferOffset);
315 }
316 GET(
317 (GLenum)pname,
318 (CTYPE *)params
319 );
320
321exit:
322 if (_array) {
323 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
324 }
325 if (_exception) {
326 jniThrowException(_env, _exceptionType, _exceptionMessage);
327 }
Jack Palevichbe509c92009-05-07 09:52:14 -0700328}
329
Jack Palevich27f80022009-04-15 19:13:17 -0700330// --------------------------------------------------------------------------
Jack Palevich27f80022009-04-15 19:13:17 -0700331/* void glActiveTexture ( GLenum texture ) */
332static void
333android_glActiveTexture__I
334 (JNIEnv *_env, jobject _this, jint texture) {
335 glActiveTexture(
336 (GLenum)texture
337 );
338}
339
340/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
341static void
342android_glAlphaFunc__IF
343 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
344 glAlphaFunc(
345 (GLenum)func,
346 (GLclampf)ref
347 );
348}
349
350/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
351static void
352android_glAlphaFuncx__II
353 (JNIEnv *_env, jobject _this, jint func, jint ref) {
354 glAlphaFuncx(
355 (GLenum)func,
356 (GLclampx)ref
357 );
358}
359
360/* void glBindTexture ( GLenum target, GLuint texture ) */
361static void
362android_glBindTexture__II
363 (JNIEnv *_env, jobject _this, jint target, jint texture) {
364 glBindTexture(
365 (GLenum)target,
366 (GLuint)texture
367 );
368}
369
370/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
371static void
372android_glBlendFunc__II
373 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
374 glBlendFunc(
375 (GLenum)sfactor,
376 (GLenum)dfactor
377 );
378}
379
380/* void glClear ( GLbitfield mask ) */
381static void
382android_glClear__I
383 (JNIEnv *_env, jobject _this, jint mask) {
384 glClear(
385 (GLbitfield)mask
386 );
387}
388
389/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
390static void
391android_glClearColor__FFFF
392 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
393 glClearColor(
394 (GLclampf)red,
395 (GLclampf)green,
396 (GLclampf)blue,
397 (GLclampf)alpha
398 );
399}
400
401/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
402static void
403android_glClearColorx__IIII
404 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
405 glClearColorx(
406 (GLclampx)red,
407 (GLclampx)green,
408 (GLclampx)blue,
409 (GLclampx)alpha
410 );
411}
412
413/* void glClearDepthf ( GLclampf depth ) */
414static void
415android_glClearDepthf__F
416 (JNIEnv *_env, jobject _this, jfloat depth) {
417 glClearDepthf(
418 (GLclampf)depth
419 );
420}
421
422/* void glClearDepthx ( GLclampx depth ) */
423static void
424android_glClearDepthx__I
425 (JNIEnv *_env, jobject _this, jint depth) {
426 glClearDepthx(
427 (GLclampx)depth
428 );
429}
430
431/* void glClearStencil ( GLint s ) */
432static void
433android_glClearStencil__I
434 (JNIEnv *_env, jobject _this, jint s) {
435 glClearStencil(
436 (GLint)s
437 );
438}
439
440/* void glClientActiveTexture ( GLenum texture ) */
441static void
442android_glClientActiveTexture__I
443 (JNIEnv *_env, jobject _this, jint texture) {
444 glClientActiveTexture(
445 (GLenum)texture
446 );
447}
448
449/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
450static void
451android_glColor4f__FFFF
452 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
453 glColor4f(
454 (GLfloat)red,
455 (GLfloat)green,
456 (GLfloat)blue,
457 (GLfloat)alpha
458 );
459}
460
461/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
462static void
463android_glColor4x__IIII
464 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
465 glColor4x(
466 (GLfixed)red,
467 (GLfixed)green,
468 (GLfixed)blue,
469 (GLfixed)alpha
470 );
471}
472
473/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
474static void
475android_glColorMask__ZZZZ
476 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
477 glColorMask(
478 (GLboolean)red,
479 (GLboolean)green,
480 (GLboolean)blue,
481 (GLboolean)alpha
482 );
483}
484
485/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
486static void
487android_glColorPointerBounds__IIILjava_nio_Buffer_2I
488 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
489 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700490 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700491 jint _remaining;
492 GLvoid *pointer = (GLvoid *) 0;
493
Jack Paleviche20ea782009-05-07 18:28:29 -0700494 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -0700495 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -0700496 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -0700497 return;
498 }
499 }
Jack Palevich27f80022009-04-15 19:13:17 -0700500 glColorPointerBounds(
501 (GLint)size,
502 (GLenum)type,
503 (GLsizei)stride,
504 (GLvoid *)pointer,
505 (GLsizei)remaining
506 );
Jack Palevich27f80022009-04-15 19:13:17 -0700507}
508
509/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
510static void
511android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
512 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
513 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700514 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700515 jint _remaining;
516 GLvoid *data = (GLvoid *) 0;
517
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700518 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
519 if (data == NULL) {
520 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
521 data = (GLvoid *) (_dataBase + _bufferOffset);
522 }
Jack Palevich27f80022009-04-15 19:13:17 -0700523 glCompressedTexImage2D(
524 (GLenum)target,
525 (GLint)level,
526 (GLenum)internalformat,
527 (GLsizei)width,
528 (GLsizei)height,
529 (GLint)border,
530 (GLsizei)imageSize,
531 (GLvoid *)data
532 );
533 if (_array) {
534 releasePointer(_env, _array, data, JNI_FALSE);
535 }
536}
537
538/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
539static void
540android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
541 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
542 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700543 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700544 jint _remaining;
545 GLvoid *data = (GLvoid *) 0;
546
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700547 data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
548 if (data == NULL) {
549 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
550 data = (GLvoid *) (_dataBase + _bufferOffset);
551 }
Jack Palevich27f80022009-04-15 19:13:17 -0700552 glCompressedTexSubImage2D(
553 (GLenum)target,
554 (GLint)level,
555 (GLint)xoffset,
556 (GLint)yoffset,
557 (GLsizei)width,
558 (GLsizei)height,
559 (GLenum)format,
560 (GLsizei)imageSize,
561 (GLvoid *)data
562 );
563 if (_array) {
564 releasePointer(_env, _array, data, JNI_FALSE);
565 }
566}
567
568/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
569static void
570android_glCopyTexImage2D__IIIIIIII
571 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
572 glCopyTexImage2D(
573 (GLenum)target,
574 (GLint)level,
575 (GLenum)internalformat,
576 (GLint)x,
577 (GLint)y,
578 (GLsizei)width,
579 (GLsizei)height,
580 (GLint)border
581 );
582}
583
584/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
585static void
586android_glCopyTexSubImage2D__IIIIIIII
587 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
588 glCopyTexSubImage2D(
589 (GLenum)target,
590 (GLint)level,
591 (GLint)xoffset,
592 (GLint)yoffset,
593 (GLint)x,
594 (GLint)y,
595 (GLsizei)width,
596 (GLsizei)height
597 );
598}
599
600/* void glCullFace ( GLenum mode ) */
601static void
602android_glCullFace__I
603 (JNIEnv *_env, jobject _this, jint mode) {
604 glCullFace(
605 (GLenum)mode
606 );
607}
608
609/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
610static void
611android_glDeleteTextures__I_3II
612 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700613 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800614 const char * _exceptionType = NULL;
615 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700616 GLuint *textures_base = (GLuint *) 0;
617 jint _remaining;
618 GLuint *textures = (GLuint *) 0;
619
620 if (!textures_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700621 _exception = 1;
622 _exceptionType = "java/lang/IllegalArgumentException";
623 _exceptionMessage = "textures == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700624 goto exit;
625 }
626 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700627 _exception = 1;
628 _exceptionType = "java/lang/IllegalArgumentException";
629 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -0700630 goto exit;
631 }
632 _remaining = _env->GetArrayLength(textures_ref) - offset;
633 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700634 _exception = 1;
635 _exceptionType = "java/lang/IllegalArgumentException";
636 _exceptionMessage = "length - offset < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700637 goto exit;
638 }
639 textures_base = (GLuint *)
640 _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
641 textures = textures_base + offset;
642
643 glDeleteTextures(
644 (GLsizei)n,
645 (GLuint *)textures
646 );
647
648exit:
649 if (textures_base) {
650 _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
651 JNI_ABORT);
652 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700653 if (_exception) {
654 jniThrowException(_env, _exceptionType, _exceptionMessage);
655 }
Jack Palevich27f80022009-04-15 19:13:17 -0700656}
657
658/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
659static void
660android_glDeleteTextures__ILjava_nio_IntBuffer_2
661 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700662 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800663 const char * _exceptionType = NULL;
664 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700665 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700666 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700667 jint _remaining;
668 GLuint *textures = (GLuint *) 0;
669
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700670 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700671 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700672 _exception = 1;
673 _exceptionType = "java/lang/IllegalArgumentException";
674 _exceptionMessage = "remaining() < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700675 goto exit;
676 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700677 if (textures == NULL) {
678 char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
679 textures = (GLuint *) (_texturesBase + _bufferOffset);
680 }
Jack Palevich27f80022009-04-15 19:13:17 -0700681 glDeleteTextures(
682 (GLsizei)n,
683 (GLuint *)textures
684 );
685
686exit:
687 if (_array) {
688 releasePointer(_env, _array, textures, JNI_FALSE);
689 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700690 if (_exception) {
691 jniThrowException(_env, _exceptionType, _exceptionMessage);
692 }
Jack Palevich27f80022009-04-15 19:13:17 -0700693}
694
695/* void glDepthFunc ( GLenum func ) */
696static void
697android_glDepthFunc__I
698 (JNIEnv *_env, jobject _this, jint func) {
699 glDepthFunc(
700 (GLenum)func
701 );
702}
703
704/* void glDepthMask ( GLboolean flag ) */
705static void
706android_glDepthMask__Z
707 (JNIEnv *_env, jobject _this, jboolean flag) {
708 glDepthMask(
709 (GLboolean)flag
710 );
711}
712
713/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
714static void
715android_glDepthRangef__FF
716 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
717 glDepthRangef(
718 (GLclampf)zNear,
719 (GLclampf)zFar
720 );
721}
722
723/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
724static void
725android_glDepthRangex__II
726 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
727 glDepthRangex(
728 (GLclampx)zNear,
729 (GLclampx)zFar
730 );
731}
732
733/* void glDisable ( GLenum cap ) */
734static void
735android_glDisable__I
736 (JNIEnv *_env, jobject _this, jint cap) {
737 glDisable(
738 (GLenum)cap
739 );
740}
741
742/* void glDisableClientState ( GLenum array ) */
743static void
744android_glDisableClientState__I
745 (JNIEnv *_env, jobject _this, jint array) {
746 glDisableClientState(
747 (GLenum)array
748 );
749}
750
751/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
752static void
753android_glDrawArrays__III
754 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
755 glDrawArrays(
756 (GLenum)mode,
757 (GLint)first,
758 (GLsizei)count
759 );
760}
761
762/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
763static void
764android_glDrawElements__IIILjava_nio_Buffer_2
765 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700766 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800767 const char * _exceptionType = NULL;
768 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700769 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700770 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700771 jint _remaining;
772 GLvoid *indices = (GLvoid *) 0;
773
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700774 indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700775 if (_remaining < count) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700776 _exception = 1;
777 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
778 _exceptionMessage = "remaining() < count < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700779 goto exit;
780 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700781 if (indices == NULL) {
782 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
783 indices = (GLvoid *) (_indicesBase + _bufferOffset);
784 }
Jack Palevich27f80022009-04-15 19:13:17 -0700785 glDrawElements(
786 (GLenum)mode,
787 (GLsizei)count,
788 (GLenum)type,
789 (GLvoid *)indices
790 );
791
792exit:
793 if (_array) {
794 releasePointer(_env, _array, indices, JNI_FALSE);
795 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700796 if (_exception) {
797 jniThrowException(_env, _exceptionType, _exceptionMessage);
798 }
Jack Palevich27f80022009-04-15 19:13:17 -0700799}
800
801/* void glEnable ( GLenum cap ) */
802static void
803android_glEnable__I
804 (JNIEnv *_env, jobject _this, jint cap) {
805 glEnable(
806 (GLenum)cap
807 );
808}
809
810/* void glEnableClientState ( GLenum array ) */
811static void
812android_glEnableClientState__I
813 (JNIEnv *_env, jobject _this, jint array) {
814 glEnableClientState(
815 (GLenum)array
816 );
817}
818
819/* void glFinish ( void ) */
820static void
821android_glFinish__
822 (JNIEnv *_env, jobject _this) {
823 glFinish();
824}
825
826/* void glFlush ( void ) */
827static void
828android_glFlush__
829 (JNIEnv *_env, jobject _this) {
830 glFlush();
831}
832
833/* void glFogf ( GLenum pname, GLfloat param ) */
834static void
835android_glFogf__IF
836 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
837 glFogf(
838 (GLenum)pname,
839 (GLfloat)param
840 );
841}
842
843/* void glFogfv ( GLenum pname, const GLfloat *params ) */
844static void
845android_glFogfv__I_3FI
846 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700847 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800848 const char * _exceptionType = NULL;
849 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700850 GLfloat *params_base = (GLfloat *) 0;
851 jint _remaining;
852 GLfloat *params = (GLfloat *) 0;
853
854 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700855 _exception = 1;
856 _exceptionType = "java/lang/IllegalArgumentException";
857 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700858 goto exit;
859 }
860 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700861 _exception = 1;
862 _exceptionType = "java/lang/IllegalArgumentException";
863 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -0700864 goto exit;
865 }
866 _remaining = _env->GetArrayLength(params_ref) - offset;
867 int _needed;
868 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -0700869#if defined(GL_FOG_COLOR)
870 case GL_FOG_COLOR:
871#endif // defined(GL_FOG_COLOR)
872 _needed = 4;
873 break;
874 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -0800875 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -0700876 break;
877 }
878 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700879 _exception = 1;
880 _exceptionType = "java/lang/IllegalArgumentException";
881 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700882 goto exit;
883 }
884 params_base = (GLfloat *)
885 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
886 params = params_base + offset;
887
888 glFogfv(
889 (GLenum)pname,
890 (GLfloat *)params
891 );
892
893exit:
894 if (params_base) {
895 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
896 JNI_ABORT);
897 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700898 if (_exception) {
899 jniThrowException(_env, _exceptionType, _exceptionMessage);
900 }
Jack Palevich27f80022009-04-15 19:13:17 -0700901}
902
903/* void glFogfv ( GLenum pname, const GLfloat *params ) */
904static void
905android_glFogfv__ILjava_nio_FloatBuffer_2
906 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700907 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800908 const char * _exceptionType = NULL;
909 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700910 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700911 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700912 jint _remaining;
913 GLfloat *params = (GLfloat *) 0;
914
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700915 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700916 int _needed;
917 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -0700918#if defined(GL_FOG_COLOR)
919 case GL_FOG_COLOR:
920#endif // defined(GL_FOG_COLOR)
921 _needed = 4;
922 break;
923 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -0800924 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -0700925 break;
926 }
927 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700928 _exception = 1;
929 _exceptionType = "java/lang/IllegalArgumentException";
930 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700931 goto exit;
932 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700933 if (params == NULL) {
934 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
935 params = (GLfloat *) (_paramsBase + _bufferOffset);
936 }
Jack Palevich27f80022009-04-15 19:13:17 -0700937 glFogfv(
938 (GLenum)pname,
939 (GLfloat *)params
940 );
941
942exit:
943 if (_array) {
944 releasePointer(_env, _array, params, JNI_FALSE);
945 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700946 if (_exception) {
947 jniThrowException(_env, _exceptionType, _exceptionMessage);
948 }
Jack Palevich27f80022009-04-15 19:13:17 -0700949}
950
951/* void glFogx ( GLenum pname, GLfixed param ) */
952static void
953android_glFogx__II
954 (JNIEnv *_env, jobject _this, jint pname, jint param) {
955 glFogx(
956 (GLenum)pname,
957 (GLfixed)param
958 );
959}
960
961/* void glFogxv ( GLenum pname, const GLfixed *params ) */
962static void
963android_glFogxv__I_3II
964 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700965 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800966 const char * _exceptionType = NULL;
967 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700968 GLfixed *params_base = (GLfixed *) 0;
969 jint _remaining;
970 GLfixed *params = (GLfixed *) 0;
971
972 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700973 _exception = 1;
974 _exceptionType = "java/lang/IllegalArgumentException";
975 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700976 goto exit;
977 }
978 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700979 _exception = 1;
980 _exceptionType = "java/lang/IllegalArgumentException";
981 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -0700982 goto exit;
983 }
984 _remaining = _env->GetArrayLength(params_ref) - offset;
985 int _needed;
986 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -0700987#if defined(GL_FOG_COLOR)
988 case GL_FOG_COLOR:
989#endif // defined(GL_FOG_COLOR)
990 _needed = 4;
991 break;
992 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -0800993 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -0700994 break;
995 }
996 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700997 _exception = 1;
998 _exceptionType = "java/lang/IllegalArgumentException";
999 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001000 goto exit;
1001 }
1002 params_base = (GLfixed *)
1003 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1004 params = params_base + offset;
1005
1006 glFogxv(
1007 (GLenum)pname,
1008 (GLfixed *)params
1009 );
1010
1011exit:
1012 if (params_base) {
1013 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1014 JNI_ABORT);
1015 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001016 if (_exception) {
1017 jniThrowException(_env, _exceptionType, _exceptionMessage);
1018 }
Jack Palevich27f80022009-04-15 19:13:17 -07001019}
1020
1021/* void glFogxv ( GLenum pname, const GLfixed *params ) */
1022static void
1023android_glFogxv__ILjava_nio_IntBuffer_2
1024 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001025 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001026 const char * _exceptionType = NULL;
1027 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001028 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001029 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001030 jint _remaining;
1031 GLfixed *params = (GLfixed *) 0;
1032
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001033 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001034 int _needed;
1035 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001036#if defined(GL_FOG_COLOR)
1037 case GL_FOG_COLOR:
1038#endif // defined(GL_FOG_COLOR)
1039 _needed = 4;
1040 break;
1041 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001042 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001043 break;
1044 }
1045 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001046 _exception = 1;
1047 _exceptionType = "java/lang/IllegalArgumentException";
1048 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001049 goto exit;
1050 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001051 if (params == NULL) {
1052 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1053 params = (GLfixed *) (_paramsBase + _bufferOffset);
1054 }
Jack Palevich27f80022009-04-15 19:13:17 -07001055 glFogxv(
1056 (GLenum)pname,
1057 (GLfixed *)params
1058 );
1059
1060exit:
1061 if (_array) {
1062 releasePointer(_env, _array, params, JNI_FALSE);
1063 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001064 if (_exception) {
1065 jniThrowException(_env, _exceptionType, _exceptionMessage);
1066 }
Jack Palevich27f80022009-04-15 19:13:17 -07001067}
1068
1069/* void glFrontFace ( GLenum mode ) */
1070static void
1071android_glFrontFace__I
1072 (JNIEnv *_env, jobject _this, jint mode) {
1073 glFrontFace(
1074 (GLenum)mode
1075 );
1076}
1077
1078/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1079static void
1080android_glFrustumf__FFFFFF
1081 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1082 glFrustumf(
1083 (GLfloat)left,
1084 (GLfloat)right,
1085 (GLfloat)bottom,
1086 (GLfloat)top,
1087 (GLfloat)zNear,
1088 (GLfloat)zFar
1089 );
1090}
1091
1092/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1093static void
1094android_glFrustumx__IIIIII
1095 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1096 glFrustumx(
1097 (GLfixed)left,
1098 (GLfixed)right,
1099 (GLfixed)bottom,
1100 (GLfixed)top,
1101 (GLfixed)zNear,
1102 (GLfixed)zFar
1103 );
1104}
1105
1106/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1107static void
1108android_glGenTextures__I_3II
1109 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1110 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001111 const char * _exceptionType = NULL;
1112 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001113 GLuint *textures_base = (GLuint *) 0;
1114 jint _remaining;
1115 GLuint *textures = (GLuint *) 0;
1116
1117 if (!textures_ref) {
1118 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001119 _exceptionType = "java/lang/IllegalArgumentException";
1120 _exceptionMessage = "textures == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001121 goto exit;
1122 }
1123 if (offset < 0) {
1124 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001125 _exceptionType = "java/lang/IllegalArgumentException";
1126 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001127 goto exit;
1128 }
1129 _remaining = _env->GetArrayLength(textures_ref) - offset;
1130 if (_remaining < n) {
1131 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001132 _exceptionType = "java/lang/IllegalArgumentException";
1133 _exceptionMessage = "length - offset < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001134 goto exit;
1135 }
1136 textures_base = (GLuint *)
1137 _env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
1138 textures = textures_base + offset;
1139
1140 glGenTextures(
1141 (GLsizei)n,
1142 (GLuint *)textures
1143 );
1144
1145exit:
1146 if (textures_base) {
1147 _env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
1148 _exception ? JNI_ABORT: 0);
1149 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001150 if (_exception) {
1151 jniThrowException(_env, _exceptionType, _exceptionMessage);
1152 }
Jack Palevich27f80022009-04-15 19:13:17 -07001153}
1154
1155/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1156static void
1157android_glGenTextures__ILjava_nio_IntBuffer_2
1158 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1159 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001160 const char * _exceptionType = NULL;
1161 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001162 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001163 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001164 jint _remaining;
1165 GLuint *textures = (GLuint *) 0;
1166
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001167 textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001168 if (_remaining < n) {
1169 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001170 _exceptionType = "java/lang/IllegalArgumentException";
1171 _exceptionMessage = "remaining() < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001172 goto exit;
1173 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001174 if (textures == NULL) {
1175 char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1176 textures = (GLuint *) (_texturesBase + _bufferOffset);
1177 }
Jack Palevich27f80022009-04-15 19:13:17 -07001178 glGenTextures(
1179 (GLsizei)n,
1180 (GLuint *)textures
1181 );
1182
1183exit:
1184 if (_array) {
1185 releasePointer(_env, _array, textures, _exception ? JNI_FALSE : JNI_TRUE);
1186 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001187 if (_exception) {
1188 jniThrowException(_env, _exceptionType, _exceptionMessage);
1189 }
Jack Palevich27f80022009-04-15 19:13:17 -07001190}
1191
1192/* GLenum glGetError ( void ) */
1193static jint
1194android_glGetError__
1195 (JNIEnv *_env, jobject _this) {
1196 GLenum _returnValue;
1197 _returnValue = glGetError();
Andy McFaddencee51982013-04-25 16:08:31 -07001198 return (jint)_returnValue;
Jack Palevich27f80022009-04-15 19:13:17 -07001199}
1200
1201/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1202static void
1203android_glGetIntegerv__I_3II
1204 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Mathias Agopian2ad04772013-02-23 03:12:30 -08001205 get<jintArray, GLint, glGetIntegerv>(_env, _this, pname, params_ref, offset);
Jack Palevich27f80022009-04-15 19:13:17 -07001206}
1207
1208/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1209static void
1210android_glGetIntegerv__ILjava_nio_IntBuffer_2
1211 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Mathias Agopian2ad04772013-02-23 03:12:30 -08001212 getarray<GLint, glGetIntegerv>(_env, _this, pname, params_buf);
Jack Palevich27f80022009-04-15 19:13:17 -07001213}
1214
Jack Palevich27f80022009-04-15 19:13:17 -07001215/* const GLubyte * glGetString ( GLenum name ) */
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07001216static jstring android_glGetString(JNIEnv* _env, jobject, jint name) {
1217 const char* chars = (const char*) glGetString((GLenum) name);
1218 return _env->NewStringUTF(chars);
Jack Palevich27f80022009-04-15 19:13:17 -07001219}
1220/* void glHint ( GLenum target, GLenum mode ) */
1221static void
1222android_glHint__II
1223 (JNIEnv *_env, jobject _this, jint target, jint mode) {
1224 glHint(
1225 (GLenum)target,
1226 (GLenum)mode
1227 );
1228}
1229
1230/* void glLightModelf ( GLenum pname, GLfloat param ) */
1231static void
1232android_glLightModelf__IF
1233 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1234 glLightModelf(
1235 (GLenum)pname,
1236 (GLfloat)param
1237 );
1238}
1239
1240/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1241static void
1242android_glLightModelfv__I_3FI
1243 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001244 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001245 const char * _exceptionType = NULL;
1246 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001247 GLfloat *params_base = (GLfloat *) 0;
1248 jint _remaining;
1249 GLfloat *params = (GLfloat *) 0;
1250
1251 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001252 _exception = 1;
1253 _exceptionType = "java/lang/IllegalArgumentException";
1254 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001255 goto exit;
1256 }
1257 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001258 _exception = 1;
1259 _exceptionType = "java/lang/IllegalArgumentException";
1260 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001261 goto exit;
1262 }
1263 _remaining = _env->GetArrayLength(params_ref) - offset;
1264 int _needed;
1265 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001266#if defined(GL_LIGHT_MODEL_AMBIENT)
1267 case GL_LIGHT_MODEL_AMBIENT:
1268#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1269 _needed = 4;
1270 break;
1271 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001272 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001273 break;
1274 }
1275 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001276 _exception = 1;
1277 _exceptionType = "java/lang/IllegalArgumentException";
1278 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001279 goto exit;
1280 }
1281 params_base = (GLfloat *)
1282 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1283 params = params_base + offset;
1284
1285 glLightModelfv(
1286 (GLenum)pname,
1287 (GLfloat *)params
1288 );
1289
1290exit:
1291 if (params_base) {
1292 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1293 JNI_ABORT);
1294 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001295 if (_exception) {
1296 jniThrowException(_env, _exceptionType, _exceptionMessage);
1297 }
Jack Palevich27f80022009-04-15 19:13:17 -07001298}
1299
1300/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1301static void
1302android_glLightModelfv__ILjava_nio_FloatBuffer_2
1303 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001304 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001305 const char * _exceptionType = NULL;
1306 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001307 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001308 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001309 jint _remaining;
1310 GLfloat *params = (GLfloat *) 0;
1311
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001312 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001313 int _needed;
1314 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001315#if defined(GL_LIGHT_MODEL_AMBIENT)
1316 case GL_LIGHT_MODEL_AMBIENT:
1317#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1318 _needed = 4;
1319 break;
1320 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001321 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001322 break;
1323 }
1324 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001325 _exception = 1;
1326 _exceptionType = "java/lang/IllegalArgumentException";
1327 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001328 goto exit;
1329 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001330 if (params == NULL) {
1331 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1332 params = (GLfloat *) (_paramsBase + _bufferOffset);
1333 }
Jack Palevich27f80022009-04-15 19:13:17 -07001334 glLightModelfv(
1335 (GLenum)pname,
1336 (GLfloat *)params
1337 );
1338
1339exit:
1340 if (_array) {
1341 releasePointer(_env, _array, params, JNI_FALSE);
1342 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001343 if (_exception) {
1344 jniThrowException(_env, _exceptionType, _exceptionMessage);
1345 }
Jack Palevich27f80022009-04-15 19:13:17 -07001346}
1347
1348/* void glLightModelx ( GLenum pname, GLfixed param ) */
1349static void
1350android_glLightModelx__II
1351 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1352 glLightModelx(
1353 (GLenum)pname,
1354 (GLfixed)param
1355 );
1356}
1357
1358/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1359static void
1360android_glLightModelxv__I_3II
1361 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001362 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001363 const char * _exceptionType = NULL;
1364 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001365 GLfixed *params_base = (GLfixed *) 0;
1366 jint _remaining;
1367 GLfixed *params = (GLfixed *) 0;
1368
1369 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001370 _exception = 1;
1371 _exceptionType = "java/lang/IllegalArgumentException";
1372 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001373 goto exit;
1374 }
1375 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001376 _exception = 1;
1377 _exceptionType = "java/lang/IllegalArgumentException";
1378 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001379 goto exit;
1380 }
1381 _remaining = _env->GetArrayLength(params_ref) - offset;
1382 int _needed;
1383 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001384#if defined(GL_LIGHT_MODEL_AMBIENT)
1385 case GL_LIGHT_MODEL_AMBIENT:
1386#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1387 _needed = 4;
1388 break;
1389 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001390 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001391 break;
1392 }
1393 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001394 _exception = 1;
1395 _exceptionType = "java/lang/IllegalArgumentException";
1396 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001397 goto exit;
1398 }
1399 params_base = (GLfixed *)
1400 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1401 params = params_base + offset;
1402
1403 glLightModelxv(
1404 (GLenum)pname,
1405 (GLfixed *)params
1406 );
1407
1408exit:
1409 if (params_base) {
1410 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1411 JNI_ABORT);
1412 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001413 if (_exception) {
1414 jniThrowException(_env, _exceptionType, _exceptionMessage);
1415 }
Jack Palevich27f80022009-04-15 19:13:17 -07001416}
1417
1418/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1419static void
1420android_glLightModelxv__ILjava_nio_IntBuffer_2
1421 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001422 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001423 const char * _exceptionType = NULL;
1424 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001425 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001426 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001427 jint _remaining;
1428 GLfixed *params = (GLfixed *) 0;
1429
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001430 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001431 int _needed;
1432 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001433#if defined(GL_LIGHT_MODEL_AMBIENT)
1434 case GL_LIGHT_MODEL_AMBIENT:
1435#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1436 _needed = 4;
1437 break;
1438 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001439 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001440 break;
1441 }
1442 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001443 _exception = 1;
1444 _exceptionType = "java/lang/IllegalArgumentException";
1445 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001446 goto exit;
1447 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001448 if (params == NULL) {
1449 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1450 params = (GLfixed *) (_paramsBase + _bufferOffset);
1451 }
Jack Palevich27f80022009-04-15 19:13:17 -07001452 glLightModelxv(
1453 (GLenum)pname,
1454 (GLfixed *)params
1455 );
1456
1457exit:
1458 if (_array) {
1459 releasePointer(_env, _array, params, JNI_FALSE);
1460 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001461 if (_exception) {
1462 jniThrowException(_env, _exceptionType, _exceptionMessage);
1463 }
Jack Palevich27f80022009-04-15 19:13:17 -07001464}
1465
1466/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
1467static void
1468android_glLightf__IIF
1469 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
1470 glLightf(
1471 (GLenum)light,
1472 (GLenum)pname,
1473 (GLfloat)param
1474 );
1475}
1476
1477/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1478static void
1479android_glLightfv__II_3FI
1480 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001481 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001482 const char * _exceptionType = NULL;
1483 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001484 GLfloat *params_base = (GLfloat *) 0;
1485 jint _remaining;
1486 GLfloat *params = (GLfloat *) 0;
1487
1488 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001489 _exception = 1;
1490 _exceptionType = "java/lang/IllegalArgumentException";
1491 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001492 goto exit;
1493 }
1494 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001495 _exception = 1;
1496 _exceptionType = "java/lang/IllegalArgumentException";
1497 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001498 goto exit;
1499 }
1500 _remaining = _env->GetArrayLength(params_ref) - offset;
1501 int _needed;
1502 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001503#if defined(GL_SPOT_DIRECTION)
1504 case GL_SPOT_DIRECTION:
1505#endif // defined(GL_SPOT_DIRECTION)
1506 _needed = 3;
1507 break;
1508#if defined(GL_AMBIENT)
1509 case GL_AMBIENT:
1510#endif // defined(GL_AMBIENT)
1511#if defined(GL_DIFFUSE)
1512 case GL_DIFFUSE:
1513#endif // defined(GL_DIFFUSE)
1514#if defined(GL_SPECULAR)
1515 case GL_SPECULAR:
1516#endif // defined(GL_SPECULAR)
1517#if defined(GL_EMISSION)
1518 case GL_EMISSION:
1519#endif // defined(GL_EMISSION)
1520 _needed = 4;
1521 break;
1522 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001523 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001524 break;
1525 }
1526 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001527 _exception = 1;
1528 _exceptionType = "java/lang/IllegalArgumentException";
1529 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001530 goto exit;
1531 }
1532 params_base = (GLfloat *)
1533 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1534 params = params_base + offset;
1535
1536 glLightfv(
1537 (GLenum)light,
1538 (GLenum)pname,
1539 (GLfloat *)params
1540 );
1541
1542exit:
1543 if (params_base) {
1544 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1545 JNI_ABORT);
1546 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001547 if (_exception) {
1548 jniThrowException(_env, _exceptionType, _exceptionMessage);
1549 }
Jack Palevich27f80022009-04-15 19:13:17 -07001550}
1551
1552/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1553static void
1554android_glLightfv__IILjava_nio_FloatBuffer_2
1555 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001556 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001557 const char * _exceptionType = NULL;
1558 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001559 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001560 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001561 jint _remaining;
1562 GLfloat *params = (GLfloat *) 0;
1563
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001564 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001565 int _needed;
1566 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001567#if defined(GL_SPOT_DIRECTION)
1568 case GL_SPOT_DIRECTION:
1569#endif // defined(GL_SPOT_DIRECTION)
1570 _needed = 3;
1571 break;
1572#if defined(GL_AMBIENT)
1573 case GL_AMBIENT:
1574#endif // defined(GL_AMBIENT)
1575#if defined(GL_DIFFUSE)
1576 case GL_DIFFUSE:
1577#endif // defined(GL_DIFFUSE)
1578#if defined(GL_SPECULAR)
1579 case GL_SPECULAR:
1580#endif // defined(GL_SPECULAR)
1581#if defined(GL_EMISSION)
1582 case GL_EMISSION:
1583#endif // defined(GL_EMISSION)
1584 _needed = 4;
1585 break;
1586 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001587 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001588 break;
1589 }
1590 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001591 _exception = 1;
1592 _exceptionType = "java/lang/IllegalArgumentException";
1593 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001594 goto exit;
1595 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001596 if (params == NULL) {
1597 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1598 params = (GLfloat *) (_paramsBase + _bufferOffset);
1599 }
Jack Palevich27f80022009-04-15 19:13:17 -07001600 glLightfv(
1601 (GLenum)light,
1602 (GLenum)pname,
1603 (GLfloat *)params
1604 );
1605
1606exit:
1607 if (_array) {
1608 releasePointer(_env, _array, params, JNI_FALSE);
1609 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001610 if (_exception) {
1611 jniThrowException(_env, _exceptionType, _exceptionMessage);
1612 }
Jack Palevich27f80022009-04-15 19:13:17 -07001613}
1614
1615/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
1616static void
1617android_glLightx__III
1618 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
1619 glLightx(
1620 (GLenum)light,
1621 (GLenum)pname,
1622 (GLfixed)param
1623 );
1624}
1625
1626/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1627static void
1628android_glLightxv__II_3II
1629 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001630 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001631 const char * _exceptionType = NULL;
1632 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001633 GLfixed *params_base = (GLfixed *) 0;
1634 jint _remaining;
1635 GLfixed *params = (GLfixed *) 0;
1636
1637 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001638 _exception = 1;
1639 _exceptionType = "java/lang/IllegalArgumentException";
1640 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001641 goto exit;
1642 }
1643 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001644 _exception = 1;
1645 _exceptionType = "java/lang/IllegalArgumentException";
1646 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001647 goto exit;
1648 }
1649 _remaining = _env->GetArrayLength(params_ref) - offset;
1650 int _needed;
1651 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001652#if defined(GL_SPOT_DIRECTION)
1653 case GL_SPOT_DIRECTION:
1654#endif // defined(GL_SPOT_DIRECTION)
1655 _needed = 3;
1656 break;
1657#if defined(GL_AMBIENT)
1658 case GL_AMBIENT:
1659#endif // defined(GL_AMBIENT)
1660#if defined(GL_DIFFUSE)
1661 case GL_DIFFUSE:
1662#endif // defined(GL_DIFFUSE)
1663#if defined(GL_SPECULAR)
1664 case GL_SPECULAR:
1665#endif // defined(GL_SPECULAR)
1666#if defined(GL_EMISSION)
1667 case GL_EMISSION:
1668#endif // defined(GL_EMISSION)
1669 _needed = 4;
1670 break;
1671 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001672 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001673 break;
1674 }
1675 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001676 _exception = 1;
1677 _exceptionType = "java/lang/IllegalArgumentException";
1678 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001679 goto exit;
1680 }
1681 params_base = (GLfixed *)
1682 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1683 params = params_base + offset;
1684
1685 glLightxv(
1686 (GLenum)light,
1687 (GLenum)pname,
1688 (GLfixed *)params
1689 );
1690
1691exit:
1692 if (params_base) {
1693 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1694 JNI_ABORT);
1695 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001696 if (_exception) {
1697 jniThrowException(_env, _exceptionType, _exceptionMessage);
1698 }
Jack Palevich27f80022009-04-15 19:13:17 -07001699}
1700
1701/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1702static void
1703android_glLightxv__IILjava_nio_IntBuffer_2
1704 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001705 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001706 const char * _exceptionType = NULL;
1707 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001708 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001709 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001710 jint _remaining;
1711 GLfixed *params = (GLfixed *) 0;
1712
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001713 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001714 int _needed;
1715 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001716#if defined(GL_SPOT_DIRECTION)
1717 case GL_SPOT_DIRECTION:
1718#endif // defined(GL_SPOT_DIRECTION)
1719 _needed = 3;
1720 break;
1721#if defined(GL_AMBIENT)
1722 case GL_AMBIENT:
1723#endif // defined(GL_AMBIENT)
1724#if defined(GL_DIFFUSE)
1725 case GL_DIFFUSE:
1726#endif // defined(GL_DIFFUSE)
1727#if defined(GL_SPECULAR)
1728 case GL_SPECULAR:
1729#endif // defined(GL_SPECULAR)
1730#if defined(GL_EMISSION)
1731 case GL_EMISSION:
1732#endif // defined(GL_EMISSION)
1733 _needed = 4;
1734 break;
1735 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001736 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001737 break;
1738 }
1739 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001740 _exception = 1;
1741 _exceptionType = "java/lang/IllegalArgumentException";
1742 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001743 goto exit;
1744 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001745 if (params == NULL) {
1746 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1747 params = (GLfixed *) (_paramsBase + _bufferOffset);
1748 }
Jack Palevich27f80022009-04-15 19:13:17 -07001749 glLightxv(
1750 (GLenum)light,
1751 (GLenum)pname,
1752 (GLfixed *)params
1753 );
1754
1755exit:
1756 if (_array) {
1757 releasePointer(_env, _array, params, JNI_FALSE);
1758 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001759 if (_exception) {
1760 jniThrowException(_env, _exceptionType, _exceptionMessage);
1761 }
Jack Palevich27f80022009-04-15 19:13:17 -07001762}
1763
1764/* void glLineWidth ( GLfloat width ) */
1765static void
1766android_glLineWidth__F
1767 (JNIEnv *_env, jobject _this, jfloat width) {
1768 glLineWidth(
1769 (GLfloat)width
1770 );
1771}
1772
1773/* void glLineWidthx ( GLfixed width ) */
1774static void
1775android_glLineWidthx__I
1776 (JNIEnv *_env, jobject _this, jint width) {
1777 glLineWidthx(
1778 (GLfixed)width
1779 );
1780}
1781
1782/* void glLoadIdentity ( void ) */
1783static void
1784android_glLoadIdentity__
1785 (JNIEnv *_env, jobject _this) {
1786 glLoadIdentity();
1787}
1788
1789/* void glLoadMatrixf ( const GLfloat *m ) */
1790static void
1791android_glLoadMatrixf___3FI
1792 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001793 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001794 const char * _exceptionType = NULL;
1795 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001796 GLfloat *m_base = (GLfloat *) 0;
1797 jint _remaining;
1798 GLfloat *m = (GLfloat *) 0;
1799
1800 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001801 _exception = 1;
1802 _exceptionType = "java/lang/IllegalArgumentException";
1803 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001804 goto exit;
1805 }
1806 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001807 _exception = 1;
1808 _exceptionType = "java/lang/IllegalArgumentException";
1809 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001810 goto exit;
1811 }
1812 _remaining = _env->GetArrayLength(m_ref) - offset;
1813 m_base = (GLfloat *)
1814 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
1815 m = m_base + offset;
1816
1817 glLoadMatrixf(
1818 (GLfloat *)m
1819 );
1820
1821exit:
1822 if (m_base) {
1823 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
1824 JNI_ABORT);
1825 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001826 if (_exception) {
1827 jniThrowException(_env, _exceptionType, _exceptionMessage);
1828 }
Jack Palevich27f80022009-04-15 19:13:17 -07001829}
1830
1831/* void glLoadMatrixf ( const GLfloat *m ) */
1832static void
1833android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
1834 (JNIEnv *_env, jobject _this, jobject m_buf) {
1835 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001836 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001837 jint _remaining;
1838 GLfloat *m = (GLfloat *) 0;
1839
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001840 m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
1841 if (m == NULL) {
1842 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1843 m = (GLfloat *) (_mBase + _bufferOffset);
1844 }
Jack Palevich27f80022009-04-15 19:13:17 -07001845 glLoadMatrixf(
1846 (GLfloat *)m
1847 );
1848 if (_array) {
1849 releasePointer(_env, _array, m, JNI_FALSE);
1850 }
1851}
1852
1853/* void glLoadMatrixx ( const GLfixed *m ) */
1854static void
1855android_glLoadMatrixx___3II
1856 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001857 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001858 const char * _exceptionType = NULL;
1859 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001860 GLfixed *m_base = (GLfixed *) 0;
1861 jint _remaining;
1862 GLfixed *m = (GLfixed *) 0;
1863
1864 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001865 _exception = 1;
1866 _exceptionType = "java/lang/IllegalArgumentException";
1867 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001868 goto exit;
1869 }
1870 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001871 _exception = 1;
1872 _exceptionType = "java/lang/IllegalArgumentException";
1873 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001874 goto exit;
1875 }
1876 _remaining = _env->GetArrayLength(m_ref) - offset;
1877 m_base = (GLfixed *)
1878 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
1879 m = m_base + offset;
1880
1881 glLoadMatrixx(
1882 (GLfixed *)m
1883 );
1884
1885exit:
1886 if (m_base) {
1887 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
1888 JNI_ABORT);
1889 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001890 if (_exception) {
1891 jniThrowException(_env, _exceptionType, _exceptionMessage);
1892 }
Jack Palevich27f80022009-04-15 19:13:17 -07001893}
1894
1895/* void glLoadMatrixx ( const GLfixed *m ) */
1896static void
1897android_glLoadMatrixx__Ljava_nio_IntBuffer_2
1898 (JNIEnv *_env, jobject _this, jobject m_buf) {
1899 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001900 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001901 jint _remaining;
1902 GLfixed *m = (GLfixed *) 0;
1903
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001904 m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
1905 if (m == NULL) {
1906 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1907 m = (GLfixed *) (_mBase + _bufferOffset);
1908 }
Jack Palevich27f80022009-04-15 19:13:17 -07001909 glLoadMatrixx(
1910 (GLfixed *)m
1911 );
1912 if (_array) {
1913 releasePointer(_env, _array, m, JNI_FALSE);
1914 }
1915}
1916
1917/* void glLogicOp ( GLenum opcode ) */
1918static void
1919android_glLogicOp__I
1920 (JNIEnv *_env, jobject _this, jint opcode) {
1921 glLogicOp(
1922 (GLenum)opcode
1923 );
1924}
1925
1926/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
1927static void
1928android_glMaterialf__IIF
1929 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
1930 glMaterialf(
1931 (GLenum)face,
1932 (GLenum)pname,
1933 (GLfloat)param
1934 );
1935}
1936
1937/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
1938static void
1939android_glMaterialfv__II_3FI
1940 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001941 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001942 const char * _exceptionType = NULL;
1943 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001944 GLfloat *params_base = (GLfloat *) 0;
1945 jint _remaining;
1946 GLfloat *params = (GLfloat *) 0;
1947
1948 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001949 _exception = 1;
1950 _exceptionType = "java/lang/IllegalArgumentException";
1951 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001952 goto exit;
1953 }
1954 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001955 _exception = 1;
1956 _exceptionType = "java/lang/IllegalArgumentException";
1957 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001958 goto exit;
1959 }
1960 _remaining = _env->GetArrayLength(params_ref) - offset;
1961 int _needed;
1962 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001963#if defined(GL_AMBIENT)
1964 case GL_AMBIENT:
1965#endif // defined(GL_AMBIENT)
1966#if defined(GL_DIFFUSE)
1967 case GL_DIFFUSE:
1968#endif // defined(GL_DIFFUSE)
1969#if defined(GL_SPECULAR)
1970 case GL_SPECULAR:
1971#endif // defined(GL_SPECULAR)
1972#if defined(GL_EMISSION)
1973 case GL_EMISSION:
1974#endif // defined(GL_EMISSION)
1975#if defined(GL_AMBIENT_AND_DIFFUSE)
1976 case GL_AMBIENT_AND_DIFFUSE:
1977#endif // defined(GL_AMBIENT_AND_DIFFUSE)
1978 _needed = 4;
1979 break;
1980 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001981 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001982 break;
1983 }
1984 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001985 _exception = 1;
1986 _exceptionType = "java/lang/IllegalArgumentException";
1987 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001988 goto exit;
1989 }
1990 params_base = (GLfloat *)
1991 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1992 params = params_base + offset;
1993
1994 glMaterialfv(
1995 (GLenum)face,
1996 (GLenum)pname,
1997 (GLfloat *)params
1998 );
1999
2000exit:
2001 if (params_base) {
2002 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2003 JNI_ABORT);
2004 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002005 if (_exception) {
2006 jniThrowException(_env, _exceptionType, _exceptionMessage);
2007 }
Jack Palevich27f80022009-04-15 19:13:17 -07002008}
2009
2010/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2011static void
2012android_glMaterialfv__IILjava_nio_FloatBuffer_2
2013 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002014 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002015 const char * _exceptionType = NULL;
2016 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002017 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002018 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002019 jint _remaining;
2020 GLfloat *params = (GLfloat *) 0;
2021
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002022 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002023 int _needed;
2024 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002025#if defined(GL_AMBIENT)
2026 case GL_AMBIENT:
2027#endif // defined(GL_AMBIENT)
2028#if defined(GL_DIFFUSE)
2029 case GL_DIFFUSE:
2030#endif // defined(GL_DIFFUSE)
2031#if defined(GL_SPECULAR)
2032 case GL_SPECULAR:
2033#endif // defined(GL_SPECULAR)
2034#if defined(GL_EMISSION)
2035 case GL_EMISSION:
2036#endif // defined(GL_EMISSION)
2037#if defined(GL_AMBIENT_AND_DIFFUSE)
2038 case GL_AMBIENT_AND_DIFFUSE:
2039#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2040 _needed = 4;
2041 break;
2042 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002043 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002044 break;
2045 }
2046 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002047 _exception = 1;
2048 _exceptionType = "java/lang/IllegalArgumentException";
2049 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002050 goto exit;
2051 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002052 if (params == NULL) {
2053 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2054 params = (GLfloat *) (_paramsBase + _bufferOffset);
2055 }
Jack Palevich27f80022009-04-15 19:13:17 -07002056 glMaterialfv(
2057 (GLenum)face,
2058 (GLenum)pname,
2059 (GLfloat *)params
2060 );
2061
2062exit:
2063 if (_array) {
2064 releasePointer(_env, _array, params, JNI_FALSE);
2065 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002066 if (_exception) {
2067 jniThrowException(_env, _exceptionType, _exceptionMessage);
2068 }
Jack Palevich27f80022009-04-15 19:13:17 -07002069}
2070
2071/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
2072static void
2073android_glMaterialx__III
2074 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
2075 glMaterialx(
2076 (GLenum)face,
2077 (GLenum)pname,
2078 (GLfixed)param
2079 );
2080}
2081
2082/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2083static void
2084android_glMaterialxv__II_3II
2085 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002086 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002087 const char * _exceptionType = NULL;
2088 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002089 GLfixed *params_base = (GLfixed *) 0;
2090 jint _remaining;
2091 GLfixed *params = (GLfixed *) 0;
2092
2093 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002094 _exception = 1;
2095 _exceptionType = "java/lang/IllegalArgumentException";
2096 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002097 goto exit;
2098 }
2099 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002100 _exception = 1;
2101 _exceptionType = "java/lang/IllegalArgumentException";
2102 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002103 goto exit;
2104 }
2105 _remaining = _env->GetArrayLength(params_ref) - offset;
2106 int _needed;
2107 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002108#if defined(GL_AMBIENT)
2109 case GL_AMBIENT:
2110#endif // defined(GL_AMBIENT)
2111#if defined(GL_DIFFUSE)
2112 case GL_DIFFUSE:
2113#endif // defined(GL_DIFFUSE)
2114#if defined(GL_SPECULAR)
2115 case GL_SPECULAR:
2116#endif // defined(GL_SPECULAR)
2117#if defined(GL_EMISSION)
2118 case GL_EMISSION:
2119#endif // defined(GL_EMISSION)
2120#if defined(GL_AMBIENT_AND_DIFFUSE)
2121 case GL_AMBIENT_AND_DIFFUSE:
2122#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2123 _needed = 4;
2124 break;
2125 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002126 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002127 break;
2128 }
2129 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002130 _exception = 1;
2131 _exceptionType = "java/lang/IllegalArgumentException";
2132 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002133 goto exit;
2134 }
2135 params_base = (GLfixed *)
2136 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2137 params = params_base + offset;
2138
2139 glMaterialxv(
2140 (GLenum)face,
2141 (GLenum)pname,
2142 (GLfixed *)params
2143 );
2144
2145exit:
2146 if (params_base) {
2147 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2148 JNI_ABORT);
2149 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002150 if (_exception) {
2151 jniThrowException(_env, _exceptionType, _exceptionMessage);
2152 }
Jack Palevich27f80022009-04-15 19:13:17 -07002153}
2154
2155/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2156static void
2157android_glMaterialxv__IILjava_nio_IntBuffer_2
2158 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002159 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002160 const char * _exceptionType = NULL;
2161 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002162 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002163 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002164 jint _remaining;
2165 GLfixed *params = (GLfixed *) 0;
2166
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002167 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002168 int _needed;
2169 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002170#if defined(GL_AMBIENT)
2171 case GL_AMBIENT:
2172#endif // defined(GL_AMBIENT)
2173#if defined(GL_DIFFUSE)
2174 case GL_DIFFUSE:
2175#endif // defined(GL_DIFFUSE)
2176#if defined(GL_SPECULAR)
2177 case GL_SPECULAR:
2178#endif // defined(GL_SPECULAR)
2179#if defined(GL_EMISSION)
2180 case GL_EMISSION:
2181#endif // defined(GL_EMISSION)
2182#if defined(GL_AMBIENT_AND_DIFFUSE)
2183 case GL_AMBIENT_AND_DIFFUSE:
2184#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2185 _needed = 4;
2186 break;
2187 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002188 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002189 break;
2190 }
2191 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002192 _exception = 1;
2193 _exceptionType = "java/lang/IllegalArgumentException";
2194 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002195 goto exit;
2196 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002197 if (params == NULL) {
2198 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2199 params = (GLfixed *) (_paramsBase + _bufferOffset);
2200 }
Jack Palevich27f80022009-04-15 19:13:17 -07002201 glMaterialxv(
2202 (GLenum)face,
2203 (GLenum)pname,
2204 (GLfixed *)params
2205 );
2206
2207exit:
2208 if (_array) {
2209 releasePointer(_env, _array, params, JNI_FALSE);
2210 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002211 if (_exception) {
2212 jniThrowException(_env, _exceptionType, _exceptionMessage);
2213 }
Jack Palevich27f80022009-04-15 19:13:17 -07002214}
2215
2216/* void glMatrixMode ( GLenum mode ) */
2217static void
2218android_glMatrixMode__I
2219 (JNIEnv *_env, jobject _this, jint mode) {
2220 glMatrixMode(
2221 (GLenum)mode
2222 );
2223}
2224
2225/* void glMultMatrixf ( const GLfloat *m ) */
2226static void
2227android_glMultMatrixf___3FI
2228 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002229 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002230 const char * _exceptionType = NULL;
2231 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002232 GLfloat *m_base = (GLfloat *) 0;
2233 jint _remaining;
2234 GLfloat *m = (GLfloat *) 0;
2235
2236 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002237 _exception = 1;
2238 _exceptionType = "java/lang/IllegalArgumentException";
2239 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002240 goto exit;
2241 }
2242 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002243 _exception = 1;
2244 _exceptionType = "java/lang/IllegalArgumentException";
2245 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002246 goto exit;
2247 }
2248 _remaining = _env->GetArrayLength(m_ref) - offset;
2249 m_base = (GLfloat *)
2250 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
2251 m = m_base + offset;
2252
2253 glMultMatrixf(
2254 (GLfloat *)m
2255 );
2256
2257exit:
2258 if (m_base) {
2259 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
2260 JNI_ABORT);
2261 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002262 if (_exception) {
2263 jniThrowException(_env, _exceptionType, _exceptionMessage);
2264 }
Jack Palevich27f80022009-04-15 19:13:17 -07002265}
2266
2267/* void glMultMatrixf ( const GLfloat *m ) */
2268static void
2269android_glMultMatrixf__Ljava_nio_FloatBuffer_2
2270 (JNIEnv *_env, jobject _this, jobject m_buf) {
2271 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002272 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002273 jint _remaining;
2274 GLfloat *m = (GLfloat *) 0;
2275
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002276 m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
2277 if (m == NULL) {
2278 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2279 m = (GLfloat *) (_mBase + _bufferOffset);
2280 }
Jack Palevich27f80022009-04-15 19:13:17 -07002281 glMultMatrixf(
2282 (GLfloat *)m
2283 );
2284 if (_array) {
2285 releasePointer(_env, _array, m, JNI_FALSE);
2286 }
2287}
2288
2289/* void glMultMatrixx ( const GLfixed *m ) */
2290static void
2291android_glMultMatrixx___3II
2292 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002293 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002294 const char * _exceptionType = NULL;
2295 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002296 GLfixed *m_base = (GLfixed *) 0;
2297 jint _remaining;
2298 GLfixed *m = (GLfixed *) 0;
2299
2300 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002301 _exception = 1;
2302 _exceptionType = "java/lang/IllegalArgumentException";
2303 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002304 goto exit;
2305 }
2306 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002307 _exception = 1;
2308 _exceptionType = "java/lang/IllegalArgumentException";
2309 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002310 goto exit;
2311 }
2312 _remaining = _env->GetArrayLength(m_ref) - offset;
2313 m_base = (GLfixed *)
2314 _env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
2315 m = m_base + offset;
2316
2317 glMultMatrixx(
2318 (GLfixed *)m
2319 );
2320
2321exit:
2322 if (m_base) {
2323 _env->ReleasePrimitiveArrayCritical(m_ref, m_base,
2324 JNI_ABORT);
2325 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002326 if (_exception) {
2327 jniThrowException(_env, _exceptionType, _exceptionMessage);
2328 }
Jack Palevich27f80022009-04-15 19:13:17 -07002329}
2330
2331/* void glMultMatrixx ( const GLfixed *m ) */
2332static void
2333android_glMultMatrixx__Ljava_nio_IntBuffer_2
2334 (JNIEnv *_env, jobject _this, jobject m_buf) {
2335 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002336 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002337 jint _remaining;
2338 GLfixed *m = (GLfixed *) 0;
2339
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002340 m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
2341 if (m == NULL) {
2342 char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2343 m = (GLfixed *) (_mBase + _bufferOffset);
2344 }
Jack Palevich27f80022009-04-15 19:13:17 -07002345 glMultMatrixx(
2346 (GLfixed *)m
2347 );
2348 if (_array) {
2349 releasePointer(_env, _array, m, JNI_FALSE);
2350 }
2351}
2352
2353/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
2354static void
2355android_glMultiTexCoord4f__IFFFF
2356 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
2357 glMultiTexCoord4f(
2358 (GLenum)target,
2359 (GLfloat)s,
2360 (GLfloat)t,
2361 (GLfloat)r,
2362 (GLfloat)q
2363 );
2364}
2365
2366/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
2367static void
2368android_glMultiTexCoord4x__IIIII
2369 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
2370 glMultiTexCoord4x(
2371 (GLenum)target,
2372 (GLfixed)s,
2373 (GLfixed)t,
2374 (GLfixed)r,
2375 (GLfixed)q
2376 );
2377}
2378
2379/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
2380static void
2381android_glNormal3f__FFF
2382 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
2383 glNormal3f(
2384 (GLfloat)nx,
2385 (GLfloat)ny,
2386 (GLfloat)nz
2387 );
2388}
2389
2390/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
2391static void
2392android_glNormal3x__III
2393 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
2394 glNormal3x(
2395 (GLfixed)nx,
2396 (GLfixed)ny,
2397 (GLfixed)nz
2398 );
2399}
2400
2401/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
2402static void
2403android_glNormalPointerBounds__IILjava_nio_Buffer_2I
2404 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
2405 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002406 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002407 jint _remaining;
2408 GLvoid *pointer = (GLvoid *) 0;
2409
Jack Paleviche20ea782009-05-07 18:28:29 -07002410 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07002411 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07002412 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07002413 return;
2414 }
2415 }
Jack Palevich27f80022009-04-15 19:13:17 -07002416 glNormalPointerBounds(
2417 (GLenum)type,
2418 (GLsizei)stride,
2419 (GLvoid *)pointer,
2420 (GLsizei)remaining
2421 );
Jack Palevich27f80022009-04-15 19:13:17 -07002422}
2423
2424/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
2425static void
2426android_glOrthof__FFFFFF
2427 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
2428 glOrthof(
2429 (GLfloat)left,
2430 (GLfloat)right,
2431 (GLfloat)bottom,
2432 (GLfloat)top,
2433 (GLfloat)zNear,
2434 (GLfloat)zFar
2435 );
2436}
2437
2438/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
2439static void
2440android_glOrthox__IIIIII
2441 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
2442 glOrthox(
2443 (GLfixed)left,
2444 (GLfixed)right,
2445 (GLfixed)bottom,
2446 (GLfixed)top,
2447 (GLfixed)zNear,
2448 (GLfixed)zFar
2449 );
2450}
2451
2452/* void glPixelStorei ( GLenum pname, GLint param ) */
2453static void
2454android_glPixelStorei__II
2455 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2456 glPixelStorei(
2457 (GLenum)pname,
2458 (GLint)param
2459 );
2460}
2461
2462/* void glPointSize ( GLfloat size ) */
2463static void
2464android_glPointSize__F
2465 (JNIEnv *_env, jobject _this, jfloat size) {
2466 glPointSize(
2467 (GLfloat)size
2468 );
2469}
2470
2471/* void glPointSizex ( GLfixed size ) */
2472static void
2473android_glPointSizex__I
2474 (JNIEnv *_env, jobject _this, jint size) {
2475 glPointSizex(
2476 (GLfixed)size
2477 );
2478}
2479
2480/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
2481static void
2482android_glPolygonOffset__FF
2483 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
2484 glPolygonOffset(
2485 (GLfloat)factor,
2486 (GLfloat)units
2487 );
2488}
2489
2490/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
2491static void
2492android_glPolygonOffsetx__II
2493 (JNIEnv *_env, jobject _this, jint factor, jint units) {
2494 glPolygonOffsetx(
2495 (GLfixed)factor,
2496 (GLfixed)units
2497 );
2498}
2499
2500/* void glPopMatrix ( void ) */
2501static void
2502android_glPopMatrix__
2503 (JNIEnv *_env, jobject _this) {
2504 glPopMatrix();
2505}
2506
2507/* void glPushMatrix ( void ) */
2508static void
2509android_glPushMatrix__
2510 (JNIEnv *_env, jobject _this) {
2511 glPushMatrix();
2512}
2513
2514/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
2515static void
2516android_glReadPixels__IIIIIILjava_nio_Buffer_2
2517 (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 -07002518 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002519 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002520 jint _remaining;
2521 GLvoid *pixels = (GLvoid *) 0;
2522
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002523 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
2524 if (pixels == NULL) {
2525 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2526 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
2527 }
Jack Palevich27f80022009-04-15 19:13:17 -07002528 glReadPixels(
2529 (GLint)x,
2530 (GLint)y,
2531 (GLsizei)width,
2532 (GLsizei)height,
2533 (GLenum)format,
2534 (GLenum)type,
2535 (GLvoid *)pixels
2536 );
2537 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002538 releasePointer(_env, _array, pixels, JNI_TRUE);
Jack Palevich27f80022009-04-15 19:13:17 -07002539 }
2540}
2541
2542/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
2543static void
2544android_glRotatef__FFFF
2545 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
2546 glRotatef(
2547 (GLfloat)angle,
2548 (GLfloat)x,
2549 (GLfloat)y,
2550 (GLfloat)z
2551 );
2552}
2553
2554/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
2555static void
2556android_glRotatex__IIII
2557 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
2558 glRotatex(
2559 (GLfixed)angle,
2560 (GLfixed)x,
2561 (GLfixed)y,
2562 (GLfixed)z
2563 );
2564}
2565
2566/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
2567static void
2568android_glSampleCoverage__FZ
2569 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
2570 glSampleCoverage(
2571 (GLclampf)value,
2572 (GLboolean)invert
2573 );
2574}
2575
2576/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
2577static void
2578android_glSampleCoveragex__IZ
2579 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
2580 glSampleCoveragex(
2581 (GLclampx)value,
2582 (GLboolean)invert
2583 );
2584}
2585
2586/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
2587static void
2588android_glScalef__FFF
2589 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
2590 glScalef(
2591 (GLfloat)x,
2592 (GLfloat)y,
2593 (GLfloat)z
2594 );
2595}
2596
2597/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
2598static void
2599android_glScalex__III
2600 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
2601 glScalex(
2602 (GLfixed)x,
2603 (GLfixed)y,
2604 (GLfixed)z
2605 );
2606}
2607
2608/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
2609static void
2610android_glScissor__IIII
2611 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
2612 glScissor(
2613 (GLint)x,
2614 (GLint)y,
2615 (GLsizei)width,
2616 (GLsizei)height
2617 );
2618}
2619
2620/* void glShadeModel ( GLenum mode ) */
2621static void
2622android_glShadeModel__I
2623 (JNIEnv *_env, jobject _this, jint mode) {
2624 glShadeModel(
2625 (GLenum)mode
2626 );
2627}
2628
2629/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
2630static void
2631android_glStencilFunc__III
2632 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
2633 glStencilFunc(
2634 (GLenum)func,
2635 (GLint)ref,
2636 (GLuint)mask
2637 );
2638}
2639
2640/* void glStencilMask ( GLuint mask ) */
2641static void
2642android_glStencilMask__I
2643 (JNIEnv *_env, jobject _this, jint mask) {
2644 glStencilMask(
2645 (GLuint)mask
2646 );
2647}
2648
2649/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
2650static void
2651android_glStencilOp__III
2652 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
2653 glStencilOp(
2654 (GLenum)fail,
2655 (GLenum)zfail,
2656 (GLenum)zpass
2657 );
2658}
2659
2660/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2661static void
2662android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
2663 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
2664 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002665 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002666 jint _remaining;
2667 GLvoid *pointer = (GLvoid *) 0;
2668
Jack Paleviche20ea782009-05-07 18:28:29 -07002669 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07002670 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07002671 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07002672 return;
2673 }
2674 }
Jack Palevich27f80022009-04-15 19:13:17 -07002675 glTexCoordPointerBounds(
2676 (GLint)size,
2677 (GLenum)type,
2678 (GLsizei)stride,
2679 (GLvoid *)pointer,
2680 (GLsizei)remaining
2681 );
Jack Palevich27f80022009-04-15 19:13:17 -07002682}
2683
2684/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
2685static void
2686android_glTexEnvf__IIF
2687 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
2688 glTexEnvf(
2689 (GLenum)target,
2690 (GLenum)pname,
2691 (GLfloat)param
2692 );
2693}
2694
2695/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2696static void
2697android_glTexEnvfv__II_3FI
2698 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002699 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002700 const char * _exceptionType = NULL;
2701 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002702 GLfloat *params_base = (GLfloat *) 0;
2703 jint _remaining;
2704 GLfloat *params = (GLfloat *) 0;
2705
2706 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002707 _exception = 1;
2708 _exceptionType = "java/lang/IllegalArgumentException";
2709 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002710 goto exit;
2711 }
2712 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002713 _exception = 1;
2714 _exceptionType = "java/lang/IllegalArgumentException";
2715 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002716 goto exit;
2717 }
2718 _remaining = _env->GetArrayLength(params_ref) - offset;
2719 int _needed;
2720 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002721#if defined(GL_TEXTURE_ENV_COLOR)
2722 case GL_TEXTURE_ENV_COLOR:
2723#endif // defined(GL_TEXTURE_ENV_COLOR)
2724 _needed = 4;
2725 break;
2726 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002727 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002728 break;
2729 }
2730 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002731 _exception = 1;
2732 _exceptionType = "java/lang/IllegalArgumentException";
2733 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002734 goto exit;
2735 }
2736 params_base = (GLfloat *)
2737 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2738 params = params_base + offset;
2739
2740 glTexEnvfv(
2741 (GLenum)target,
2742 (GLenum)pname,
2743 (GLfloat *)params
2744 );
2745
2746exit:
2747 if (params_base) {
2748 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2749 JNI_ABORT);
2750 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002751 if (_exception) {
2752 jniThrowException(_env, _exceptionType, _exceptionMessage);
2753 }
Jack Palevich27f80022009-04-15 19:13:17 -07002754}
2755
2756/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2757static void
2758android_glTexEnvfv__IILjava_nio_FloatBuffer_2
2759 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002760 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002761 const char * _exceptionType = NULL;
2762 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002763 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002764 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002765 jint _remaining;
2766 GLfloat *params = (GLfloat *) 0;
2767
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002768 params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002769 int _needed;
2770 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002771#if defined(GL_TEXTURE_ENV_COLOR)
2772 case GL_TEXTURE_ENV_COLOR:
2773#endif // defined(GL_TEXTURE_ENV_COLOR)
2774 _needed = 4;
2775 break;
2776 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002777 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002778 break;
2779 }
2780 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002781 _exception = 1;
2782 _exceptionType = "java/lang/IllegalArgumentException";
2783 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002784 goto exit;
2785 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002786 if (params == NULL) {
2787 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2788 params = (GLfloat *) (_paramsBase + _bufferOffset);
2789 }
Jack Palevich27f80022009-04-15 19:13:17 -07002790 glTexEnvfv(
2791 (GLenum)target,
2792 (GLenum)pname,
2793 (GLfloat *)params
2794 );
2795
2796exit:
2797 if (_array) {
2798 releasePointer(_env, _array, params, JNI_FALSE);
2799 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002800 if (_exception) {
2801 jniThrowException(_env, _exceptionType, _exceptionMessage);
2802 }
Jack Palevich27f80022009-04-15 19:13:17 -07002803}
2804
2805/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
2806static void
2807android_glTexEnvx__III
2808 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
2809 glTexEnvx(
2810 (GLenum)target,
2811 (GLenum)pname,
2812 (GLfixed)param
2813 );
2814}
2815
2816/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2817static void
2818android_glTexEnvxv__II_3II
2819 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002820 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002821 const char * _exceptionType = NULL;
2822 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002823 GLfixed *params_base = (GLfixed *) 0;
2824 jint _remaining;
2825 GLfixed *params = (GLfixed *) 0;
2826
2827 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002828 _exception = 1;
2829 _exceptionType = "java/lang/IllegalArgumentException";
2830 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002831 goto exit;
2832 }
2833 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002834 _exception = 1;
2835 _exceptionType = "java/lang/IllegalArgumentException";
2836 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002837 goto exit;
2838 }
2839 _remaining = _env->GetArrayLength(params_ref) - offset;
2840 int _needed;
2841 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002842#if defined(GL_TEXTURE_ENV_COLOR)
2843 case GL_TEXTURE_ENV_COLOR:
2844#endif // defined(GL_TEXTURE_ENV_COLOR)
2845 _needed = 4;
2846 break;
2847 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002848 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002849 break;
2850 }
2851 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002852 _exception = 1;
2853 _exceptionType = "java/lang/IllegalArgumentException";
2854 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002855 goto exit;
2856 }
2857 params_base = (GLfixed *)
2858 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
2859 params = params_base + offset;
2860
2861 glTexEnvxv(
2862 (GLenum)target,
2863 (GLenum)pname,
2864 (GLfixed *)params
2865 );
2866
2867exit:
2868 if (params_base) {
2869 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
2870 JNI_ABORT);
2871 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002872 if (_exception) {
2873 jniThrowException(_env, _exceptionType, _exceptionMessage);
2874 }
Jack Palevich27f80022009-04-15 19:13:17 -07002875}
2876
2877/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2878static void
2879android_glTexEnvxv__IILjava_nio_IntBuffer_2
2880 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002881 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002882 const char * _exceptionType = NULL;
2883 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002884 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002885 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002886 jint _remaining;
2887 GLfixed *params = (GLfixed *) 0;
2888
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002889 params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002890 int _needed;
2891 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002892#if defined(GL_TEXTURE_ENV_COLOR)
2893 case GL_TEXTURE_ENV_COLOR:
2894#endif // defined(GL_TEXTURE_ENV_COLOR)
2895 _needed = 4;
2896 break;
2897 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002898 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002899 break;
2900 }
2901 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002902 _exception = 1;
2903 _exceptionType = "java/lang/IllegalArgumentException";
2904 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002905 goto exit;
2906 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002907 if (params == NULL) {
2908 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2909 params = (GLfixed *) (_paramsBase + _bufferOffset);
2910 }
Jack Palevich27f80022009-04-15 19:13:17 -07002911 glTexEnvxv(
2912 (GLenum)target,
2913 (GLenum)pname,
2914 (GLfixed *)params
2915 );
2916
2917exit:
2918 if (_array) {
2919 releasePointer(_env, _array, params, JNI_FALSE);
2920 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002921 if (_exception) {
2922 jniThrowException(_env, _exceptionType, _exceptionMessage);
2923 }
Jack Palevich27f80022009-04-15 19:13:17 -07002924}
2925
2926/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
2927static void
2928android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
2929 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
2930 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002931 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002932 jint _remaining;
2933 GLvoid *pixels = (GLvoid *) 0;
2934
2935 if (pixels_buf) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002936 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
2937 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07002938 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002939 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2940 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002941 }
2942 glTexImage2D(
2943 (GLenum)target,
2944 (GLint)level,
2945 (GLint)internalformat,
2946 (GLsizei)width,
2947 (GLsizei)height,
2948 (GLint)border,
2949 (GLenum)format,
2950 (GLenum)type,
2951 (GLvoid *)pixels
2952 );
2953 if (_array) {
2954 releasePointer(_env, _array, pixels, JNI_FALSE);
2955 }
2956}
2957
2958/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
2959static void
2960android_glTexParameterf__IIF
2961 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
2962 glTexParameterf(
2963 (GLenum)target,
2964 (GLenum)pname,
2965 (GLfloat)param
2966 );
2967}
2968
2969/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
2970static void
2971android_glTexParameterx__III
2972 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
2973 glTexParameterx(
2974 (GLenum)target,
2975 (GLenum)pname,
2976 (GLfixed)param
2977 );
2978}
2979
2980/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
2981static void
2982android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
2983 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
2984 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002985 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002986 jint _remaining;
2987 GLvoid *pixels = (GLvoid *) 0;
2988
2989 if (pixels_buf) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002990 pixels = (GLvoid *)getPointer(_env, pixels_buf, &_array, &_remaining, &_bufferOffset);
2991 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07002992 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002993 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2994 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002995 }
2996 glTexSubImage2D(
2997 (GLenum)target,
2998 (GLint)level,
2999 (GLint)xoffset,
3000 (GLint)yoffset,
3001 (GLsizei)width,
3002 (GLsizei)height,
3003 (GLenum)format,
3004 (GLenum)type,
3005 (GLvoid *)pixels
3006 );
3007 if (_array) {
3008 releasePointer(_env, _array, pixels, JNI_FALSE);
3009 }
3010}
3011
3012/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
3013static void
3014android_glTranslatef__FFF
3015 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3016 glTranslatef(
3017 (GLfloat)x,
3018 (GLfloat)y,
3019 (GLfloat)z
3020 );
3021}
3022
3023/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
3024static void
3025android_glTranslatex__III
3026 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3027 glTranslatex(
3028 (GLfixed)x,
3029 (GLfixed)y,
3030 (GLfixed)z
3031 );
3032}
3033
3034/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3035static void
3036android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
3037 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3038 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003039 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003040 jint _remaining;
3041 GLvoid *pointer = (GLvoid *) 0;
3042
Jack Paleviche20ea782009-05-07 18:28:29 -07003043 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003044 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003045 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003046 return;
3047 }
3048 }
Jack Palevich27f80022009-04-15 19:13:17 -07003049 glVertexPointerBounds(
3050 (GLint)size,
3051 (GLenum)type,
3052 (GLsizei)stride,
3053 (GLvoid *)pointer,
3054 (GLsizei)remaining
3055 );
Jack Palevich27f80022009-04-15 19:13:17 -07003056}
3057
3058/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3059static void
3060android_glViewport__IIII
3061 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3062 glViewport(
3063 (GLint)x,
3064 (GLint)y,
3065 (GLsizei)width,
3066 (GLsizei)height
3067 );
3068}
3069
3070static const char *classPathName = "android/opengl/GLES10";
3071
3072static JNINativeMethod methods[] = {
3073{"_nativeClassInit", "()V", (void*)nativeClassInit },
3074{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
3075{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
3076{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
3077{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
3078{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
3079{"glClear", "(I)V", (void *) android_glClear__I },
3080{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
3081{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
3082{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
3083{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
3084{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
3085{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
3086{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
3087{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
3088{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
3089{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
3090{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
3091{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3092{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
3093{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
3094{"glCullFace", "(I)V", (void *) android_glCullFace__I },
3095{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
3096{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
3097{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
3098{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
3099{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
3100{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
3101{"glDisable", "(I)V", (void *) android_glDisable__I },
3102{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
3103{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
3104{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
3105{"glEnable", "(I)V", (void *) android_glEnable__I },
3106{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
3107{"glFinish", "()V", (void *) android_glFinish__ },
3108{"glFlush", "()V", (void *) android_glFlush__ },
3109{"glFogf", "(IF)V", (void *) android_glFogf__IF },
3110{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
3111{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
3112{"glFogx", "(II)V", (void *) android_glFogx__II },
3113{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
3114{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
3115{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
3116{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
3117{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
3118{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
3119{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
3120{"glGetError", "()I", (void *) android_glGetError__ },
3121{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
3122{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
Jack Palevicha3795852009-04-24 10:35:11 -07003123{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
Jack Palevich27f80022009-04-15 19:13:17 -07003124{"glHint", "(II)V", (void *) android_glHint__II },
3125{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
3126{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
3127{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
3128{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
3129{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
3130{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
3131{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
3132{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
3133{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
3134{"glLightx", "(III)V", (void *) android_glLightx__III },
3135{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
3136{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
3137{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
3138{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
3139{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
3140{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
3141{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
3142{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
3143{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
3144{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
3145{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
3146{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
3147{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
3148{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
3149{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
3150{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
3151{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
3152{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
3153{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
3154{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
3155{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
3156{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
3157{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
3158{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
3159{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
3160{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
3161{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
3162{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
3163{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
3164{"glPointSize", "(F)V", (void *) android_glPointSize__F },
3165{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
3166{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
3167{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
3168{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
3169{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
3170{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
3171{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
3172{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
3173{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
3174{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
3175{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
3176{"glScalex", "(III)V", (void *) android_glScalex__III },
3177{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
3178{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
3179{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
3180{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
3181{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
3182{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
3183{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
3184{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
3185{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
3186{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
3187{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
3188{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
3189{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
3190{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
3191{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
3192{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3193{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
3194{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
3195{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
3196{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
3197};
3198
3199int register_android_opengl_jni_GLES10(JNIEnv *_env)
3200{
3201 int err;
3202 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
3203 return err;
3204}