1 /*
2 **
3 ** Copyright 2009, The Android Open Source Project
4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at
8 **
9 ** http://www.apache.org/licenses/LICENSE-2.0
10 **
11 ** Unless required by applicable law or agreed to in writing, software
12 ** distributed under the License is distributed on an "AS IS" BASIS,
13 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ** See the License for the specific language governing permissions and
15 ** limitations under the License.
16 */
17
18 // This source file is automatically generated
19
20 #pragma GCC diagnostic ignored "-Wunused-variable"
21 #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
22 #pragma GCC diagnostic ignored "-Wunused-function"
23
24 #include <GLES/gl.h>
25 #include <GLES/glext.h>
26
27 #include <jni.h>
28 #include <nativehelper/JNIPlatformHelp.h>
29 #include <android_runtime/AndroidRuntime.h>
30 #include <utils/misc.h>
31 #include <assert.h>
32
33
34 /* special calls implemented in Android's GLES wrapper used to more
35 * efficiently bound-check passed arrays */
36 extern "C" {
37 #ifdef GL_VERSION_ES_CM_1_1
38 GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
39 const GLvoid *ptr, GLsizei count);
40 GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
41 const GLvoid *pointer, GLsizei count);
42 GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
43 GLsizei stride, const GLvoid *pointer, GLsizei count);
44 GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
45 GLsizei stride, const GLvoid *pointer, GLsizei count);
46 GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
47 GLsizei stride, const GLvoid *pointer, GLsizei count);
48 GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
49 GLsizei stride, const GLvoid *pointer, GLsizei count);
50 GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
51 GLsizei stride, const GLvoid *pointer, GLsizei count);
52 #endif
53 #ifdef GL_ES_VERSION_2_0
glVertexAttribPointerBounds(GLuint indx,GLint size,GLenum type,GLboolean normalized,GLsizei stride,const GLvoid * pointer,GLsizei count)54 static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
55 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
56 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
57 }
58 #endif
59 #ifdef GL_ES_VERSION_3_0
glVertexAttribIPointerBounds(GLuint indx,GLint size,GLenum type,GLsizei stride,const GLvoid * pointer,GLsizei count)60 static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
61 GLsizei stride, const GLvoid *pointer, GLsizei count) {
62 glVertexAttribIPointer(indx, size, type, stride, pointer);
63 }
64 #endif
65 }
66
67 static void
nativeClassInit(JNIEnv * _env,jclass glImplClass)68 nativeClassInit(JNIEnv *_env, jclass glImplClass)
69 {
70 }
71
72 static void *
getPointer(JNIEnv * _env,jobject buffer,jarray * array,jint * remaining,jint * offset)73 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
74 {
75 jint position;
76 jint limit;
77 jint elementSizeShift;
78 jlong pointer;
79
80 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
81 *remaining = (limit - position) << elementSizeShift;
82 if (pointer != 0L) {
83 *array = nullptr;
84 pointer += position << elementSizeShift;
85 return reinterpret_cast<void*>(pointer);
86 }
87
88 *array = jniGetNioBufferBaseArray(_env, buffer);
89 *offset = jniGetNioBufferBaseArrayOffset(_env, buffer);
90 return nullptr;
91 }
92
93 class ByteArrayGetter {
94 public:
Get(JNIEnv * _env,jbyteArray array,jboolean * is_copy)95 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
96 return _env->GetByteArrayElements(array, is_copy);
97 }
98 };
99 class BooleanArrayGetter {
100 public:
Get(JNIEnv * _env,jbooleanArray array,jboolean * is_copy)101 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
102 return _env->GetBooleanArrayElements(array, is_copy);
103 }
104 };
105 class CharArrayGetter {
106 public:
Get(JNIEnv * _env,jcharArray array,jboolean * is_copy)107 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
108 return _env->GetCharArrayElements(array, is_copy);
109 }
110 };
111 class ShortArrayGetter {
112 public:
Get(JNIEnv * _env,jshortArray array,jboolean * is_copy)113 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
114 return _env->GetShortArrayElements(array, is_copy);
115 }
116 };
117 class IntArrayGetter {
118 public:
Get(JNIEnv * _env,jintArray array,jboolean * is_copy)119 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
120 return _env->GetIntArrayElements(array, is_copy);
121 }
122 };
123 class LongArrayGetter {
124 public:
Get(JNIEnv * _env,jlongArray array,jboolean * is_copy)125 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
126 return _env->GetLongArrayElements(array, is_copy);
127 }
128 };
129 class FloatArrayGetter {
130 public:
Get(JNIEnv * _env,jfloatArray array,jboolean * is_copy)131 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
132 return _env->GetFloatArrayElements(array, is_copy);
133 }
134 };
135 class DoubleArrayGetter {
136 public:
Get(JNIEnv * _env,jdoubleArray array,jboolean * is_copy)137 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
138 return _env->GetDoubleArrayElements(array, is_copy);
139 }
140 };
141
142 template<typename JTYPEARRAY, typename ARRAYGETTER>
143 static void*
getArrayPointer(JNIEnv * _env,JTYPEARRAY array,jboolean * is_copy)144 getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
145 return ARRAYGETTER::Get(_env, array, is_copy);
146 }
147
148 class ByteArrayReleaser {
149 public:
Release(JNIEnv * _env,jbyteArray array,jbyte * data,jboolean commit)150 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
151 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
152 }
153 };
154 class BooleanArrayReleaser {
155 public:
Release(JNIEnv * _env,jbooleanArray array,jboolean * data,jboolean commit)156 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
157 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
158 }
159 };
160 class CharArrayReleaser {
161 public:
Release(JNIEnv * _env,jcharArray array,jchar * data,jboolean commit)162 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
163 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
164 }
165 };
166 class ShortArrayReleaser {
167 public:
Release(JNIEnv * _env,jshortArray array,jshort * data,jboolean commit)168 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
169 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
170 }
171 };
172 class IntArrayReleaser {
173 public:
Release(JNIEnv * _env,jintArray array,jint * data,jboolean commit)174 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
175 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
176 }
177 };
178 class LongArrayReleaser {
179 public:
Release(JNIEnv * _env,jlongArray array,jlong * data,jboolean commit)180 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
181 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
182 }
183 };
184 class FloatArrayReleaser {
185 public:
Release(JNIEnv * _env,jfloatArray array,jfloat * data,jboolean commit)186 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
187 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
188 }
189 };
190 class DoubleArrayReleaser {
191 public:
Release(JNIEnv * _env,jdoubleArray array,jdouble * data,jboolean commit)192 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
193 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
194 }
195 };
196
197 template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
198 static void
releaseArrayPointer(JNIEnv * _env,JTYPEARRAY array,NTYPEARRAY data,jboolean commit)199 releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
200 ARRAYRELEASER::Release(_env, array, data, commit);
201 }
202
203 static void
releasePointer(JNIEnv * _env,jarray array,void * data,jboolean commit)204 releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
205 {
206 _env->ReleasePrimitiveArrayCritical(array, data,
207 commit ? 0 : JNI_ABORT);
208 }
209
210 static void *
getDirectBufferPointer(JNIEnv * _env,jobject buffer)211 getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
212 jint position;
213 jint limit;
214 jint elementSizeShift;
215 jlong pointer;
216 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
217 if (pointer == 0) {
218 jniThrowException(_env, "java/lang/IllegalArgumentException",
219 "Must use a native order direct Buffer");
220 return nullptr;
221 }
222 pointer += position << elementSizeShift;
223 return reinterpret_cast<void*>(pointer);
224 }
225
226 // --------------------------------------------------------------------------
227
228 /*
229 * returns the number of values glGet returns for a given pname.
230 *
231 * The code below is written such that pnames requiring only one values
232 * are the default (and are not explicitely tested for). This makes the
233 * checking code much shorter/readable/efficient.
234 *
235 * This means that unknown pnames (e.g.: extensions) will default to 1. If
236 * that unknown pname needs more than 1 value, then the validation check
237 * is incomplete and the app may crash if it passed the wrong number params.
238 */
getNeededCount(GLint pname)239 static int getNeededCount(GLint pname) {
240 int needed = 1;
241 #ifdef GL_ES_VERSION_3_0
242 // GLES 3.x pnames
243 switch (pname) {
244 case GL_MAX_VIEWPORT_DIMS:
245 needed = 2;
246 break;
247
248 case GL_PROGRAM_BINARY_FORMATS:
249 glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
250 break;
251 }
252 #endif
253
254 #ifdef GL_ES_VERSION_2_0
255 // GLES 2.x pnames
256 switch (pname) {
257 case GL_ALIASED_LINE_WIDTH_RANGE:
258 case GL_ALIASED_POINT_SIZE_RANGE:
259 needed = 2;
260 break;
261
262 case GL_BLEND_COLOR:
263 case GL_COLOR_CLEAR_VALUE:
264 case GL_COLOR_WRITEMASK:
265 case GL_SCISSOR_BOX:
266 case GL_VIEWPORT:
267 needed = 4;
268 break;
269
270 case GL_COMPRESSED_TEXTURE_FORMATS:
271 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
272 break;
273
274 case GL_SHADER_BINARY_FORMATS:
275 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
276 break;
277 }
278 #endif
279
280 #ifdef GL_VERSION_ES_CM_1_1
281 // GLES 1.x pnames
282 switch (pname) {
283 case GL_ALIASED_LINE_WIDTH_RANGE:
284 case GL_ALIASED_POINT_SIZE_RANGE:
285 case GL_DEPTH_RANGE:
286 case GL_SMOOTH_LINE_WIDTH_RANGE:
287 case GL_SMOOTH_POINT_SIZE_RANGE:
288 needed = 2;
289 break;
290
291 case GL_CURRENT_NORMAL:
292 case GL_POINT_DISTANCE_ATTENUATION:
293 needed = 3;
294 break;
295
296 case GL_COLOR_CLEAR_VALUE:
297 case GL_COLOR_WRITEMASK:
298 case GL_CURRENT_COLOR:
299 case GL_CURRENT_TEXTURE_COORDS:
300 case GL_FOG_COLOR:
301 case GL_LIGHT_MODEL_AMBIENT:
302 case GL_SCISSOR_BOX:
303 case GL_VIEWPORT:
304 needed = 4;
305 break;
306
307 case GL_MODELVIEW_MATRIX:
308 case GL_PROJECTION_MATRIX:
309 case GL_TEXTURE_MATRIX:
310 needed = 16;
311 break;
312
313 case GL_COMPRESSED_TEXTURE_FORMATS:
314 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
315 break;
316 }
317 #endif
318 return needed;
319 }
320
321 template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
322 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
323 static void
get(JNIEnv * _env,jobject _this,jint pname,JTYPEARRAY params_ref,jint offset)324 get
325 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
326 jint _exception = 0;
327 const char * _exceptionType;
328 const char * _exceptionMessage;
329 CTYPE *params_base = (CTYPE *) 0;
330 jint _remaining;
331 CTYPE *params = (CTYPE *) 0;
332 int _needed = 0;
333
334 if (!params_ref) {
335 _exception = 1;
336 _exceptionType = "java/lang/IllegalArgumentException";
337 _exceptionMessage = "params == null";
338 goto exit;
339 }
340 if (offset < 0) {
341 _exception = 1;
342 _exceptionType = "java/lang/IllegalArgumentException";
343 _exceptionMessage = "offset < 0";
344 goto exit;
345 }
346 _remaining = _env->GetArrayLength(params_ref) - offset;
347 _needed = getNeededCount(pname);
348 // if we didn't find this pname, we just assume the user passed
349 // an array of the right size -- this might happen with extensions
350 // or if we forget an enum here.
351 if (_remaining < _needed) {
352 _exception = 1;
353 _exceptionType = "java/lang/IllegalArgumentException";
354 _exceptionMessage = "length - offset < needed";
355 goto exit;
356 }
357 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
358 _env, params_ref, (jboolean *)0);
359 params = params_base + offset;
360
361 GET(
362 (GLenum)pname,
363 (CTYPE *)params
364 );
365
366 exit:
367 if (params_base) {
368 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
369 _env, params_ref, params_base, !_exception);
370 }
371 if (_exception) {
372 jniThrowException(_env, _exceptionType, _exceptionMessage);
373 }
374 }
375
376
377 template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
378 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
379 static void
getarray(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)380 getarray
381 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
382 jint _exception = 0;
383 const char * _exceptionType;
384 const char * _exceptionMessage;
385 JTYPEARRAY _array = (JTYPEARRAY) 0;
386 jint _bufferOffset = (jint) 0;
387 jint _remaining;
388 CTYPE *params = (CTYPE *) 0;
389 int _needed = 0;
390
391 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
392 _remaining /= sizeof(CTYPE); // convert from bytes to item count
393 _needed = getNeededCount(pname);
394 // if we didn't find this pname, we just assume the user passed
395 // an array of the right size -- this might happen with extensions
396 // or if we forget an enum here.
397 if (_needed>0 && _remaining < _needed) {
398 _exception = 1;
399 _exceptionType = "java/lang/IllegalArgumentException";
400 _exceptionMessage = "remaining() < needed";
401 goto exit;
402 }
403 if (params == NULL) {
404 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
405 _env, _array, (jboolean *) 0);
406 params = (CTYPE *) (_paramsBase + _bufferOffset);
407 }
408 GET(
409 (GLenum)pname,
410 (CTYPE *)params
411 );
412
413 exit:
414 if (_array) {
415 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
416 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
417 }
418 if (_exception) {
419 jniThrowException(_env, _exceptionType, _exceptionMessage);
420 }
421 }
422
423 // --------------------------------------------------------------------------
424 /* void glActiveTexture ( GLenum texture ) */
425 static void
android_glActiveTexture__I(JNIEnv * _env,jobject _this,jint texture)426 android_glActiveTexture__I
427 (JNIEnv *_env, jobject _this, jint texture) {
428 glActiveTexture(
429 (GLenum)texture
430 );
431 }
432
433 /* void glAlphaFunc ( GLenum func, GLclampf ref ) */
434 static void
android_glAlphaFunc__IF(JNIEnv * _env,jobject _this,jint func,jfloat ref)435 android_glAlphaFunc__IF
436 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
437 glAlphaFunc(
438 (GLenum)func,
439 (GLclampf)ref
440 );
441 }
442
443 /* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
444 static void
android_glAlphaFuncx__II(JNIEnv * _env,jobject _this,jint func,jint ref)445 android_glAlphaFuncx__II
446 (JNIEnv *_env, jobject _this, jint func, jint ref) {
447 glAlphaFuncx(
448 (GLenum)func,
449 (GLclampx)ref
450 );
451 }
452
453 /* void glBindTexture ( GLenum target, GLuint texture ) */
454 static void
android_glBindTexture__II(JNIEnv * _env,jobject _this,jint target,jint texture)455 android_glBindTexture__II
456 (JNIEnv *_env, jobject _this, jint target, jint texture) {
457 glBindTexture(
458 (GLenum)target,
459 (GLuint)texture
460 );
461 }
462
463 /* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
464 static void
android_glBlendFunc__II(JNIEnv * _env,jobject _this,jint sfactor,jint dfactor)465 android_glBlendFunc__II
466 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
467 glBlendFunc(
468 (GLenum)sfactor,
469 (GLenum)dfactor
470 );
471 }
472
473 /* void glClear ( GLbitfield mask ) */
474 static void
android_glClear__I(JNIEnv * _env,jobject _this,jint mask)475 android_glClear__I
476 (JNIEnv *_env, jobject _this, jint mask) {
477 glClear(
478 (GLbitfield)mask
479 );
480 }
481
482 /* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
483 static void
android_glClearColor__FFFF(JNIEnv * _env,jobject _this,jfloat red,jfloat green,jfloat blue,jfloat alpha)484 android_glClearColor__FFFF
485 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
486 glClearColor(
487 (GLclampf)red,
488 (GLclampf)green,
489 (GLclampf)blue,
490 (GLclampf)alpha
491 );
492 }
493
494 /* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
495 static void
android_glClearColorx__IIII(JNIEnv * _env,jobject _this,jint red,jint green,jint blue,jint alpha)496 android_glClearColorx__IIII
497 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
498 glClearColorx(
499 (GLclampx)red,
500 (GLclampx)green,
501 (GLclampx)blue,
502 (GLclampx)alpha
503 );
504 }
505
506 /* void glClearDepthf ( GLclampf depth ) */
507 static void
android_glClearDepthf__F(JNIEnv * _env,jobject _this,jfloat depth)508 android_glClearDepthf__F
509 (JNIEnv *_env, jobject _this, jfloat depth) {
510 glClearDepthf(
511 (GLclampf)depth
512 );
513 }
514
515 /* void glClearDepthx ( GLclampx depth ) */
516 static void
android_glClearDepthx__I(JNIEnv * _env,jobject _this,jint depth)517 android_glClearDepthx__I
518 (JNIEnv *_env, jobject _this, jint depth) {
519 glClearDepthx(
520 (GLclampx)depth
521 );
522 }
523
524 /* void glClearStencil ( GLint s ) */
525 static void
android_glClearStencil__I(JNIEnv * _env,jobject _this,jint s)526 android_glClearStencil__I
527 (JNIEnv *_env, jobject _this, jint s) {
528 glClearStencil(
529 (GLint)s
530 );
531 }
532
533 /* void glClientActiveTexture ( GLenum texture ) */
534 static void
android_glClientActiveTexture__I(JNIEnv * _env,jobject _this,jint texture)535 android_glClientActiveTexture__I
536 (JNIEnv *_env, jobject _this, jint texture) {
537 glClientActiveTexture(
538 (GLenum)texture
539 );
540 }
541
542 /* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
543 static void
android_glColor4f__FFFF(JNIEnv * _env,jobject _this,jfloat red,jfloat green,jfloat blue,jfloat alpha)544 android_glColor4f__FFFF
545 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
546 glColor4f(
547 (GLfloat)red,
548 (GLfloat)green,
549 (GLfloat)blue,
550 (GLfloat)alpha
551 );
552 }
553
554 /* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
555 static void
android_glColor4x__IIII(JNIEnv * _env,jobject _this,jint red,jint green,jint blue,jint alpha)556 android_glColor4x__IIII
557 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
558 glColor4x(
559 (GLfixed)red,
560 (GLfixed)green,
561 (GLfixed)blue,
562 (GLfixed)alpha
563 );
564 }
565
566 /* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
567 static void
android_glColorMask__ZZZZ(JNIEnv * _env,jobject _this,jboolean red,jboolean green,jboolean blue,jboolean alpha)568 android_glColorMask__ZZZZ
569 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
570 glColorMask(
571 (GLboolean)red,
572 (GLboolean)green,
573 (GLboolean)blue,
574 (GLboolean)alpha
575 );
576 }
577
578 /* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
579 static void
android_glColorPointerBounds__IIILjava_nio_Buffer_2I(JNIEnv * _env,jobject _this,jint size,jint type,jint stride,jobject pointer_buf,jint remaining)580 android_glColorPointerBounds__IIILjava_nio_Buffer_2I
581 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
582 jint _exception = 0;
583 const char * _exceptionType = NULL;
584 const char * _exceptionMessage = NULL;
585 jarray _array = (jarray) 0;
586 jint _bufferOffset = (jint) 0;
587 jint _remaining;
588 GLvoid *pointer = (GLvoid *) 0;
589
590 if (pointer_buf) {
591 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
592 if ( ! pointer ) {
593 return;
594 }
595 }
596 glColorPointerBounds(
597 (GLint)size,
598 (GLenum)type,
599 (GLsizei)stride,
600 (GLvoid *)pointer,
601 (GLsizei)remaining
602 );
603 if (_exception) {
604 jniThrowException(_env, _exceptionType, _exceptionMessage);
605 }
606 }
607
608 /* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
609 static void
android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2(JNIEnv * _env,jobject _this,jint target,jint level,jint internalformat,jint width,jint height,jint border,jint imageSize,jobject data_buf)610 android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
611 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
612 jint _exception = 0;
613 const char * _exceptionType = NULL;
614 const char * _exceptionMessage = NULL;
615 jarray _array = (jarray) 0;
616 jint _bufferOffset = (jint) 0;
617 jint _remaining;
618 GLvoid *data = (GLvoid *) 0;
619
620 if (!data_buf) {
621 _exception = 1;
622 _exceptionType = "java/lang/IllegalArgumentException";
623 _exceptionMessage = "data == null";
624 goto exit;
625 }
626 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
627 if (data == NULL) {
628 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
629 data = (GLvoid *) (_dataBase + _bufferOffset);
630 }
631 glCompressedTexImage2D(
632 (GLenum)target,
633 (GLint)level,
634 (GLenum)internalformat,
635 (GLsizei)width,
636 (GLsizei)height,
637 (GLint)border,
638 (GLsizei)imageSize,
639 (GLvoid *)data
640 );
641
642 exit:
643 if (_array) {
644 releasePointer(_env, _array, (void *)((char *)data - _bufferOffset), JNI_FALSE);
645 }
646 if (_exception) {
647 jniThrowException(_env, _exceptionType, _exceptionMessage);
648 }
649 }
650
651 /* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
652 static void
android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2(JNIEnv * _env,jobject _this,jint target,jint level,jint xoffset,jint yoffset,jint width,jint height,jint format,jint imageSize,jobject data_buf)653 android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
654 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
655 jint _exception = 0;
656 const char * _exceptionType = NULL;
657 const char * _exceptionMessage = NULL;
658 jarray _array = (jarray) 0;
659 jint _bufferOffset = (jint) 0;
660 jint _remaining;
661 GLvoid *data = (GLvoid *) 0;
662
663 if (!data_buf) {
664 _exception = 1;
665 _exceptionType = "java/lang/IllegalArgumentException";
666 _exceptionMessage = "data == null";
667 goto exit;
668 }
669 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
670 if (data == NULL) {
671 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
672 data = (GLvoid *) (_dataBase + _bufferOffset);
673 }
674 glCompressedTexSubImage2D(
675 (GLenum)target,
676 (GLint)level,
677 (GLint)xoffset,
678 (GLint)yoffset,
679 (GLsizei)width,
680 (GLsizei)height,
681 (GLenum)format,
682 (GLsizei)imageSize,
683 (GLvoid *)data
684 );
685
686 exit:
687 if (_array) {
688 releasePointer(_env, _array, (void *)((char *)data - _bufferOffset), JNI_FALSE);
689 }
690 if (_exception) {
691 jniThrowException(_env, _exceptionType, _exceptionMessage);
692 }
693 }
694
695 /* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
696 static void
android_glCopyTexImage2D__IIIIIIII(JNIEnv * _env,jobject _this,jint target,jint level,jint internalformat,jint x,jint y,jint width,jint height,jint border)697 android_glCopyTexImage2D__IIIIIIII
698 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
699 glCopyTexImage2D(
700 (GLenum)target,
701 (GLint)level,
702 (GLenum)internalformat,
703 (GLint)x,
704 (GLint)y,
705 (GLsizei)width,
706 (GLsizei)height,
707 (GLint)border
708 );
709 }
710
711 /* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
712 static void
android_glCopyTexSubImage2D__IIIIIIII(JNIEnv * _env,jobject _this,jint target,jint level,jint xoffset,jint yoffset,jint x,jint y,jint width,jint height)713 android_glCopyTexSubImage2D__IIIIIIII
714 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
715 glCopyTexSubImage2D(
716 (GLenum)target,
717 (GLint)level,
718 (GLint)xoffset,
719 (GLint)yoffset,
720 (GLint)x,
721 (GLint)y,
722 (GLsizei)width,
723 (GLsizei)height
724 );
725 }
726
727 /* void glCullFace ( GLenum mode ) */
728 static void
android_glCullFace__I(JNIEnv * _env,jobject _this,jint mode)729 android_glCullFace__I
730 (JNIEnv *_env, jobject _this, jint mode) {
731 glCullFace(
732 (GLenum)mode
733 );
734 }
735
736 /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
737 static void
android_glDeleteTextures__I_3II(JNIEnv * _env,jobject _this,jint n,jintArray textures_ref,jint offset)738 android_glDeleteTextures__I_3II
739 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
740 jint _exception = 0;
741 const char * _exceptionType = NULL;
742 const char * _exceptionMessage = NULL;
743 GLuint *textures_base = (GLuint *) 0;
744 jint _remaining;
745 GLuint *textures = (GLuint *) 0;
746
747 if (!textures_ref) {
748 _exception = 1;
749 _exceptionType = "java/lang/IllegalArgumentException";
750 _exceptionMessage = "textures == null";
751 goto exit;
752 }
753 if (offset < 0) {
754 _exception = 1;
755 _exceptionType = "java/lang/IllegalArgumentException";
756 _exceptionMessage = "offset < 0";
757 goto exit;
758 }
759 _remaining = _env->GetArrayLength(textures_ref) - offset;
760 if (_remaining < n) {
761 _exception = 1;
762 _exceptionType = "java/lang/IllegalArgumentException";
763 _exceptionMessage = "length - offset < n < needed";
764 goto exit;
765 }
766 textures_base = (GLuint *)
767 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
768 textures = textures_base + offset;
769
770 glDeleteTextures(
771 (GLsizei)n,
772 (GLuint *)textures
773 );
774
775 exit:
776 if (textures_base) {
777 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
778 JNI_ABORT);
779 }
780 if (_exception) {
781 jniThrowException(_env, _exceptionType, _exceptionMessage);
782 }
783 }
784
785 /* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
786 static void
android_glDeleteTextures__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint n,jobject textures_buf)787 android_glDeleteTextures__ILjava_nio_IntBuffer_2
788 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
789 jint _exception = 0;
790 const char * _exceptionType = NULL;
791 const char * _exceptionMessage = NULL;
792 jintArray _array = (jintArray) 0;
793 jint _bufferOffset = (jint) 0;
794 jint _remaining;
795 GLuint *textures = (GLuint *) 0;
796
797 if (!textures_buf) {
798 _exception = 1;
799 _exceptionType = "java/lang/IllegalArgumentException";
800 _exceptionMessage = "textures == null";
801 goto exit;
802 }
803 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
804 if (_remaining < n) {
805 _exception = 1;
806 _exceptionType = "java/lang/IllegalArgumentException";
807 _exceptionMessage = "remaining() < n < needed";
808 goto exit;
809 }
810 if (textures == NULL) {
811 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
812 textures = (GLuint *) (_texturesBase + _bufferOffset);
813 }
814 glDeleteTextures(
815 (GLsizei)n,
816 (GLuint *)textures
817 );
818
819 exit:
820 if (_array) {
821 _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT);
822 }
823 if (_exception) {
824 jniThrowException(_env, _exceptionType, _exceptionMessage);
825 }
826 }
827
828 /* void glDepthFunc ( GLenum func ) */
829 static void
android_glDepthFunc__I(JNIEnv * _env,jobject _this,jint func)830 android_glDepthFunc__I
831 (JNIEnv *_env, jobject _this, jint func) {
832 glDepthFunc(
833 (GLenum)func
834 );
835 }
836
837 /* void glDepthMask ( GLboolean flag ) */
838 static void
android_glDepthMask__Z(JNIEnv * _env,jobject _this,jboolean flag)839 android_glDepthMask__Z
840 (JNIEnv *_env, jobject _this, jboolean flag) {
841 glDepthMask(
842 (GLboolean)flag
843 );
844 }
845
846 /* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
847 static void
android_glDepthRangef__FF(JNIEnv * _env,jobject _this,jfloat zNear,jfloat zFar)848 android_glDepthRangef__FF
849 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
850 glDepthRangef(
851 (GLclampf)zNear,
852 (GLclampf)zFar
853 );
854 }
855
856 /* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
857 static void
android_glDepthRangex__II(JNIEnv * _env,jobject _this,jint zNear,jint zFar)858 android_glDepthRangex__II
859 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
860 glDepthRangex(
861 (GLclampx)zNear,
862 (GLclampx)zFar
863 );
864 }
865
866 /* void glDisable ( GLenum cap ) */
867 static void
android_glDisable__I(JNIEnv * _env,jobject _this,jint cap)868 android_glDisable__I
869 (JNIEnv *_env, jobject _this, jint cap) {
870 glDisable(
871 (GLenum)cap
872 );
873 }
874
875 /* void glDisableClientState ( GLenum array ) */
876 static void
android_glDisableClientState__I(JNIEnv * _env,jobject _this,jint array)877 android_glDisableClientState__I
878 (JNIEnv *_env, jobject _this, jint array) {
879 glDisableClientState(
880 (GLenum)array
881 );
882 }
883
884 /* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
885 static void
android_glDrawArrays__III(JNIEnv * _env,jobject _this,jint mode,jint first,jint count)886 android_glDrawArrays__III
887 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
888 glDrawArrays(
889 (GLenum)mode,
890 (GLint)first,
891 (GLsizei)count
892 );
893 }
894
895 /* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
896 static void
android_glDrawElements__IIILjava_nio_Buffer_2(JNIEnv * _env,jobject _this,jint mode,jint count,jint type,jobject indices_buf)897 android_glDrawElements__IIILjava_nio_Buffer_2
898 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
899 jint _exception = 0;
900 const char * _exceptionType = NULL;
901 const char * _exceptionMessage = NULL;
902 jarray _array = (jarray) 0;
903 jint _bufferOffset = (jint) 0;
904 jint _remaining;
905 GLvoid *indices = (GLvoid *) 0;
906
907 if (!indices_buf) {
908 _exception = 1;
909 _exceptionType = "java/lang/IllegalArgumentException";
910 _exceptionMessage = "indices == null";
911 goto exit;
912 }
913 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
914 if (_remaining < count) {
915 _exception = 1;
916 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
917 _exceptionMessage = "remaining() < count < needed";
918 goto exit;
919 }
920 if (indices == NULL) {
921 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
922 indices = (GLvoid *) (_indicesBase + _bufferOffset);
923 }
924 glDrawElements(
925 (GLenum)mode,
926 (GLsizei)count,
927 (GLenum)type,
928 (GLvoid *)indices
929 );
930
931 exit:
932 if (_array) {
933 releasePointer(_env, _array, (void *)((char *)indices - _bufferOffset), JNI_FALSE);
934 }
935 if (_exception) {
936 jniThrowException(_env, _exceptionType, _exceptionMessage);
937 }
938 }
939
940 /* void glEnable ( GLenum cap ) */
941 static void
android_glEnable__I(JNIEnv * _env,jobject _this,jint cap)942 android_glEnable__I
943 (JNIEnv *_env, jobject _this, jint cap) {
944 glEnable(
945 (GLenum)cap
946 );
947 }
948
949 /* void glEnableClientState ( GLenum array ) */
950 static void
android_glEnableClientState__I(JNIEnv * _env,jobject _this,jint array)951 android_glEnableClientState__I
952 (JNIEnv *_env, jobject _this, jint array) {
953 glEnableClientState(
954 (GLenum)array
955 );
956 }
957
958 /* void glFinish ( void ) */
959 static void
android_glFinish__(JNIEnv * _env,jobject _this)960 android_glFinish__
961 (JNIEnv *_env, jobject _this) {
962 glFinish();
963 }
964
965 /* void glFlush ( void ) */
966 static void
android_glFlush__(JNIEnv * _env,jobject _this)967 android_glFlush__
968 (JNIEnv *_env, jobject _this) {
969 glFlush();
970 }
971
972 /* void glFogf ( GLenum pname, GLfloat param ) */
973 static void
android_glFogf__IF(JNIEnv * _env,jobject _this,jint pname,jfloat param)974 android_glFogf__IF
975 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
976 glFogf(
977 (GLenum)pname,
978 (GLfloat)param
979 );
980 }
981
982 /* void glFogfv ( GLenum pname, const GLfloat *params ) */
983 static void
android_glFogfv__I_3FI(JNIEnv * _env,jobject _this,jint pname,jfloatArray params_ref,jint offset)984 android_glFogfv__I_3FI
985 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
986 jint _exception = 0;
987 const char * _exceptionType = NULL;
988 const char * _exceptionMessage = NULL;
989 GLfloat *params_base = (GLfloat *) 0;
990 jint _remaining;
991 GLfloat *params = (GLfloat *) 0;
992
993 if (!params_ref) {
994 _exception = 1;
995 _exceptionType = "java/lang/IllegalArgumentException";
996 _exceptionMessage = "params == null";
997 goto exit;
998 }
999 if (offset < 0) {
1000 _exception = 1;
1001 _exceptionType = "java/lang/IllegalArgumentException";
1002 _exceptionMessage = "offset < 0";
1003 goto exit;
1004 }
1005 _remaining = _env->GetArrayLength(params_ref) - offset;
1006 int _needed;
1007 switch (pname) {
1008 #if defined(GL_FOG_COLOR)
1009 case GL_FOG_COLOR:
1010 #endif // defined(GL_FOG_COLOR)
1011 _needed = 4;
1012 break;
1013 default:
1014 _needed = 1;
1015 break;
1016 }
1017 if (_remaining < _needed) {
1018 _exception = 1;
1019 _exceptionType = "java/lang/IllegalArgumentException";
1020 _exceptionMessage = "length - offset < needed";
1021 goto exit;
1022 }
1023 params_base = (GLfloat *)
1024 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1025 params = params_base + offset;
1026
1027 glFogfv(
1028 (GLenum)pname,
1029 (GLfloat *)params
1030 );
1031
1032 exit:
1033 if (params_base) {
1034 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1035 JNI_ABORT);
1036 }
1037 if (_exception) {
1038 jniThrowException(_env, _exceptionType, _exceptionMessage);
1039 }
1040 }
1041
1042 /* void glFogfv ( GLenum pname, const GLfloat *params ) */
1043 static void
android_glFogfv__ILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)1044 android_glFogfv__ILjava_nio_FloatBuffer_2
1045 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1046 jint _exception = 0;
1047 const char * _exceptionType = NULL;
1048 const char * _exceptionMessage = NULL;
1049 jfloatArray _array = (jfloatArray) 0;
1050 jint _bufferOffset = (jint) 0;
1051 jint _remaining;
1052 GLfloat *params = (GLfloat *) 0;
1053
1054 if (!params_buf) {
1055 _exception = 1;
1056 _exceptionType = "java/lang/IllegalArgumentException";
1057 _exceptionMessage = "params == null";
1058 goto exit;
1059 }
1060 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1061 int _needed;
1062 switch (pname) {
1063 #if defined(GL_FOG_COLOR)
1064 case GL_FOG_COLOR:
1065 #endif // defined(GL_FOG_COLOR)
1066 _needed = 4;
1067 break;
1068 default:
1069 _needed = 1;
1070 break;
1071 }
1072 if (_remaining < _needed) {
1073 _exception = 1;
1074 _exceptionType = "java/lang/IllegalArgumentException";
1075 _exceptionMessage = "remaining() < needed";
1076 goto exit;
1077 }
1078 if (params == NULL) {
1079 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1080 params = (GLfloat *) (_paramsBase + _bufferOffset);
1081 }
1082 glFogfv(
1083 (GLenum)pname,
1084 (GLfloat *)params
1085 );
1086
1087 exit:
1088 if (_array) {
1089 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
1090 }
1091 if (_exception) {
1092 jniThrowException(_env, _exceptionType, _exceptionMessage);
1093 }
1094 }
1095
1096 /* void glFogx ( GLenum pname, GLfixed param ) */
1097 static void
android_glFogx__II(JNIEnv * _env,jobject _this,jint pname,jint param)1098 android_glFogx__II
1099 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1100 glFogx(
1101 (GLenum)pname,
1102 (GLfixed)param
1103 );
1104 }
1105
1106 /* void glFogxv ( GLenum pname, const GLfixed *params ) */
1107 static void
android_glFogxv__I_3II(JNIEnv * _env,jobject _this,jint pname,jintArray params_ref,jint offset)1108 android_glFogxv__I_3II
1109 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1110 jint _exception = 0;
1111 const char * _exceptionType = NULL;
1112 const char * _exceptionMessage = NULL;
1113 GLfixed *params_base = (GLfixed *) 0;
1114 jint _remaining;
1115 GLfixed *params = (GLfixed *) 0;
1116
1117 if (!params_ref) {
1118 _exception = 1;
1119 _exceptionType = "java/lang/IllegalArgumentException";
1120 _exceptionMessage = "params == null";
1121 goto exit;
1122 }
1123 if (offset < 0) {
1124 _exception = 1;
1125 _exceptionType = "java/lang/IllegalArgumentException";
1126 _exceptionMessage = "offset < 0";
1127 goto exit;
1128 }
1129 _remaining = _env->GetArrayLength(params_ref) - offset;
1130 int _needed;
1131 switch (pname) {
1132 #if defined(GL_FOG_COLOR)
1133 case GL_FOG_COLOR:
1134 #endif // defined(GL_FOG_COLOR)
1135 _needed = 4;
1136 break;
1137 default:
1138 _needed = 1;
1139 break;
1140 }
1141 if (_remaining < _needed) {
1142 _exception = 1;
1143 _exceptionType = "java/lang/IllegalArgumentException";
1144 _exceptionMessage = "length - offset < needed";
1145 goto exit;
1146 }
1147 params_base = (GLfixed *)
1148 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1149 params = params_base + offset;
1150
1151 glFogxv(
1152 (GLenum)pname,
1153 (GLfixed *)params
1154 );
1155
1156 exit:
1157 if (params_base) {
1158 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1159 JNI_ABORT);
1160 }
1161 if (_exception) {
1162 jniThrowException(_env, _exceptionType, _exceptionMessage);
1163 }
1164 }
1165
1166 /* void glFogxv ( GLenum pname, const GLfixed *params ) */
1167 static void
android_glFogxv__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)1168 android_glFogxv__ILjava_nio_IntBuffer_2
1169 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1170 jint _exception = 0;
1171 const char * _exceptionType = NULL;
1172 const char * _exceptionMessage = NULL;
1173 jintArray _array = (jintArray) 0;
1174 jint _bufferOffset = (jint) 0;
1175 jint _remaining;
1176 GLfixed *params = (GLfixed *) 0;
1177
1178 if (!params_buf) {
1179 _exception = 1;
1180 _exceptionType = "java/lang/IllegalArgumentException";
1181 _exceptionMessage = "params == null";
1182 goto exit;
1183 }
1184 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1185 int _needed;
1186 switch (pname) {
1187 #if defined(GL_FOG_COLOR)
1188 case GL_FOG_COLOR:
1189 #endif // defined(GL_FOG_COLOR)
1190 _needed = 4;
1191 break;
1192 default:
1193 _needed = 1;
1194 break;
1195 }
1196 if (_remaining < _needed) {
1197 _exception = 1;
1198 _exceptionType = "java/lang/IllegalArgumentException";
1199 _exceptionMessage = "remaining() < needed";
1200 goto exit;
1201 }
1202 if (params == NULL) {
1203 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1204 params = (GLfixed *) (_paramsBase + _bufferOffset);
1205 }
1206 glFogxv(
1207 (GLenum)pname,
1208 (GLfixed *)params
1209 );
1210
1211 exit:
1212 if (_array) {
1213 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
1214 }
1215 if (_exception) {
1216 jniThrowException(_env, _exceptionType, _exceptionMessage);
1217 }
1218 }
1219
1220 /* void glFrontFace ( GLenum mode ) */
1221 static void
android_glFrontFace__I(JNIEnv * _env,jobject _this,jint mode)1222 android_glFrontFace__I
1223 (JNIEnv *_env, jobject _this, jint mode) {
1224 glFrontFace(
1225 (GLenum)mode
1226 );
1227 }
1228
1229 /* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1230 static void
android_glFrustumf__FFFFFF(JNIEnv * _env,jobject _this,jfloat left,jfloat right,jfloat bottom,jfloat top,jfloat zNear,jfloat zFar)1231 android_glFrustumf__FFFFFF
1232 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1233 glFrustumf(
1234 (GLfloat)left,
1235 (GLfloat)right,
1236 (GLfloat)bottom,
1237 (GLfloat)top,
1238 (GLfloat)zNear,
1239 (GLfloat)zFar
1240 );
1241 }
1242
1243 /* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1244 static void
android_glFrustumx__IIIIII(JNIEnv * _env,jobject _this,jint left,jint right,jint bottom,jint top,jint zNear,jint zFar)1245 android_glFrustumx__IIIIII
1246 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1247 glFrustumx(
1248 (GLfixed)left,
1249 (GLfixed)right,
1250 (GLfixed)bottom,
1251 (GLfixed)top,
1252 (GLfixed)zNear,
1253 (GLfixed)zFar
1254 );
1255 }
1256
1257 /* void glGenTextures ( GLsizei n, GLuint *textures ) */
1258 static void
android_glGenTextures__I_3II(JNIEnv * _env,jobject _this,jint n,jintArray textures_ref,jint offset)1259 android_glGenTextures__I_3II
1260 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1261 jint _exception = 0;
1262 const char * _exceptionType = NULL;
1263 const char * _exceptionMessage = NULL;
1264 GLuint *textures_base = (GLuint *) 0;
1265 jint _remaining;
1266 GLuint *textures = (GLuint *) 0;
1267
1268 if (!textures_ref) {
1269 _exception = 1;
1270 _exceptionType = "java/lang/IllegalArgumentException";
1271 _exceptionMessage = "textures == null";
1272 goto exit;
1273 }
1274 if (offset < 0) {
1275 _exception = 1;
1276 _exceptionType = "java/lang/IllegalArgumentException";
1277 _exceptionMessage = "offset < 0";
1278 goto exit;
1279 }
1280 _remaining = _env->GetArrayLength(textures_ref) - offset;
1281 if (_remaining < n) {
1282 _exception = 1;
1283 _exceptionType = "java/lang/IllegalArgumentException";
1284 _exceptionMessage = "length - offset < n < needed";
1285 goto exit;
1286 }
1287 textures_base = (GLuint *)
1288 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
1289 textures = textures_base + offset;
1290
1291 glGenTextures(
1292 (GLsizei)n,
1293 (GLuint *)textures
1294 );
1295
1296 exit:
1297 if (textures_base) {
1298 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
1299 _exception ? JNI_ABORT: 0);
1300 }
1301 if (_exception) {
1302 jniThrowException(_env, _exceptionType, _exceptionMessage);
1303 }
1304 }
1305
1306 /* void glGenTextures ( GLsizei n, GLuint *textures ) */
1307 static void
android_glGenTextures__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint n,jobject textures_buf)1308 android_glGenTextures__ILjava_nio_IntBuffer_2
1309 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1310 jint _exception = 0;
1311 const char * _exceptionType = NULL;
1312 const char * _exceptionMessage = NULL;
1313 jintArray _array = (jintArray) 0;
1314 jint _bufferOffset = (jint) 0;
1315 jint _remaining;
1316 GLuint *textures = (GLuint *) 0;
1317
1318 if (!textures_buf) {
1319 _exception = 1;
1320 _exceptionType = "java/lang/IllegalArgumentException";
1321 _exceptionMessage = "textures == null";
1322 goto exit;
1323 }
1324 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1325 if (_remaining < n) {
1326 _exception = 1;
1327 _exceptionType = "java/lang/IllegalArgumentException";
1328 _exceptionMessage = "remaining() < n < needed";
1329 goto exit;
1330 }
1331 if (textures == NULL) {
1332 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1333 textures = (GLuint *) (_texturesBase + _bufferOffset);
1334 }
1335 glGenTextures(
1336 (GLsizei)n,
1337 (GLuint *)textures
1338 );
1339
1340 exit:
1341 if (_array) {
1342 _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0);
1343 }
1344 if (_exception) {
1345 jniThrowException(_env, _exceptionType, _exceptionMessage);
1346 }
1347 }
1348
1349 /* GLenum glGetError ( void ) */
1350 static jint
android_glGetError__(JNIEnv * _env,jobject _this)1351 android_glGetError__
1352 (JNIEnv *_env, jobject _this) {
1353 GLenum _returnValue;
1354 _returnValue = glGetError();
1355 return (jint)_returnValue;
1356 }
1357
1358 /* void glGetIntegerv ( GLenum pname, GLint *params ) */
1359 static void
android_glGetIntegerv__I_3II(JNIEnv * _env,jobject _this,jint pname,jintArray params_ref,jint offset)1360 android_glGetIntegerv__I_3II
1361 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1362 get<jintArray, IntArrayGetter, jint*, IntArrayReleaser, GLint, glGetIntegerv>(
1363 _env, _this, pname, params_ref, offset);
1364 }
1365
1366 /* void glGetIntegerv ( GLenum pname, GLint *params ) */
1367 static void
android_glGetIntegerv__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)1368 android_glGetIntegerv__ILjava_nio_IntBuffer_2
1369 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1370 getarray<GLint, jintArray, IntArrayGetter, jint*, IntArrayReleaser, glGetIntegerv>(
1371 _env, _this, pname, params_buf);
1372 }
1373 /* const GLubyte * glGetString ( GLenum name ) */
android_glGetString(JNIEnv * _env,jobject,jint name)1374 static jstring android_glGetString(JNIEnv* _env, jobject, jint name) {
1375 const char* chars = (const char*) glGetString((GLenum) name);
1376 return _env->NewStringUTF(chars);
1377 }
1378 /* void glHint ( GLenum target, GLenum mode ) */
1379 static void
android_glHint__II(JNIEnv * _env,jobject _this,jint target,jint mode)1380 android_glHint__II
1381 (JNIEnv *_env, jobject _this, jint target, jint mode) {
1382 glHint(
1383 (GLenum)target,
1384 (GLenum)mode
1385 );
1386 }
1387
1388 /* void glLightModelf ( GLenum pname, GLfloat param ) */
1389 static void
android_glLightModelf__IF(JNIEnv * _env,jobject _this,jint pname,jfloat param)1390 android_glLightModelf__IF
1391 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1392 glLightModelf(
1393 (GLenum)pname,
1394 (GLfloat)param
1395 );
1396 }
1397
1398 /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1399 static void
android_glLightModelfv__I_3FI(JNIEnv * _env,jobject _this,jint pname,jfloatArray params_ref,jint offset)1400 android_glLightModelfv__I_3FI
1401 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
1402 jint _exception = 0;
1403 const char * _exceptionType = NULL;
1404 const char * _exceptionMessage = NULL;
1405 GLfloat *params_base = (GLfloat *) 0;
1406 jint _remaining;
1407 GLfloat *params = (GLfloat *) 0;
1408
1409 if (!params_ref) {
1410 _exception = 1;
1411 _exceptionType = "java/lang/IllegalArgumentException";
1412 _exceptionMessage = "params == null";
1413 goto exit;
1414 }
1415 if (offset < 0) {
1416 _exception = 1;
1417 _exceptionType = "java/lang/IllegalArgumentException";
1418 _exceptionMessage = "offset < 0";
1419 goto exit;
1420 }
1421 _remaining = _env->GetArrayLength(params_ref) - offset;
1422 int _needed;
1423 switch (pname) {
1424 #if defined(GL_LIGHT_MODEL_AMBIENT)
1425 case GL_LIGHT_MODEL_AMBIENT:
1426 #endif // defined(GL_LIGHT_MODEL_AMBIENT)
1427 _needed = 4;
1428 break;
1429 default:
1430 _needed = 1;
1431 break;
1432 }
1433 if (_remaining < _needed) {
1434 _exception = 1;
1435 _exceptionType = "java/lang/IllegalArgumentException";
1436 _exceptionMessage = "length - offset < needed";
1437 goto exit;
1438 }
1439 params_base = (GLfloat *)
1440 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1441 params = params_base + offset;
1442
1443 glLightModelfv(
1444 (GLenum)pname,
1445 (GLfloat *)params
1446 );
1447
1448 exit:
1449 if (params_base) {
1450 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1451 JNI_ABORT);
1452 }
1453 if (_exception) {
1454 jniThrowException(_env, _exceptionType, _exceptionMessage);
1455 }
1456 }
1457
1458 /* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1459 static void
android_glLightModelfv__ILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)1460 android_glLightModelfv__ILjava_nio_FloatBuffer_2
1461 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1462 jint _exception = 0;
1463 const char * _exceptionType = NULL;
1464 const char * _exceptionMessage = NULL;
1465 jfloatArray _array = (jfloatArray) 0;
1466 jint _bufferOffset = (jint) 0;
1467 jint _remaining;
1468 GLfloat *params = (GLfloat *) 0;
1469
1470 if (!params_buf) {
1471 _exception = 1;
1472 _exceptionType = "java/lang/IllegalArgumentException";
1473 _exceptionMessage = "params == null";
1474 goto exit;
1475 }
1476 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1477 int _needed;
1478 switch (pname) {
1479 #if defined(GL_LIGHT_MODEL_AMBIENT)
1480 case GL_LIGHT_MODEL_AMBIENT:
1481 #endif // defined(GL_LIGHT_MODEL_AMBIENT)
1482 _needed = 4;
1483 break;
1484 default:
1485 _needed = 1;
1486 break;
1487 }
1488 if (_remaining < _needed) {
1489 _exception = 1;
1490 _exceptionType = "java/lang/IllegalArgumentException";
1491 _exceptionMessage = "remaining() < needed";
1492 goto exit;
1493 }
1494 if (params == NULL) {
1495 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1496 params = (GLfloat *) (_paramsBase + _bufferOffset);
1497 }
1498 glLightModelfv(
1499 (GLenum)pname,
1500 (GLfloat *)params
1501 );
1502
1503 exit:
1504 if (_array) {
1505 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
1506 }
1507 if (_exception) {
1508 jniThrowException(_env, _exceptionType, _exceptionMessage);
1509 }
1510 }
1511
1512 /* void glLightModelx ( GLenum pname, GLfixed param ) */
1513 static void
android_glLightModelx__II(JNIEnv * _env,jobject _this,jint pname,jint param)1514 android_glLightModelx__II
1515 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1516 glLightModelx(
1517 (GLenum)pname,
1518 (GLfixed)param
1519 );
1520 }
1521
1522 /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1523 static void
android_glLightModelxv__I_3II(JNIEnv * _env,jobject _this,jint pname,jintArray params_ref,jint offset)1524 android_glLightModelxv__I_3II
1525 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
1526 jint _exception = 0;
1527 const char * _exceptionType = NULL;
1528 const char * _exceptionMessage = NULL;
1529 GLfixed *params_base = (GLfixed *) 0;
1530 jint _remaining;
1531 GLfixed *params = (GLfixed *) 0;
1532
1533 if (!params_ref) {
1534 _exception = 1;
1535 _exceptionType = "java/lang/IllegalArgumentException";
1536 _exceptionMessage = "params == null";
1537 goto exit;
1538 }
1539 if (offset < 0) {
1540 _exception = 1;
1541 _exceptionType = "java/lang/IllegalArgumentException";
1542 _exceptionMessage = "offset < 0";
1543 goto exit;
1544 }
1545 _remaining = _env->GetArrayLength(params_ref) - offset;
1546 int _needed;
1547 switch (pname) {
1548 #if defined(GL_LIGHT_MODEL_AMBIENT)
1549 case GL_LIGHT_MODEL_AMBIENT:
1550 #endif // defined(GL_LIGHT_MODEL_AMBIENT)
1551 _needed = 4;
1552 break;
1553 default:
1554 _needed = 1;
1555 break;
1556 }
1557 if (_remaining < _needed) {
1558 _exception = 1;
1559 _exceptionType = "java/lang/IllegalArgumentException";
1560 _exceptionMessage = "length - offset < needed";
1561 goto exit;
1562 }
1563 params_base = (GLfixed *)
1564 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1565 params = params_base + offset;
1566
1567 glLightModelxv(
1568 (GLenum)pname,
1569 (GLfixed *)params
1570 );
1571
1572 exit:
1573 if (params_base) {
1574 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1575 JNI_ABORT);
1576 }
1577 if (_exception) {
1578 jniThrowException(_env, _exceptionType, _exceptionMessage);
1579 }
1580 }
1581
1582 /* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1583 static void
android_glLightModelxv__ILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint pname,jobject params_buf)1584 android_glLightModelxv__ILjava_nio_IntBuffer_2
1585 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
1586 jint _exception = 0;
1587 const char * _exceptionType = NULL;
1588 const char * _exceptionMessage = NULL;
1589 jintArray _array = (jintArray) 0;
1590 jint _bufferOffset = (jint) 0;
1591 jint _remaining;
1592 GLfixed *params = (GLfixed *) 0;
1593
1594 if (!params_buf) {
1595 _exception = 1;
1596 _exceptionType = "java/lang/IllegalArgumentException";
1597 _exceptionMessage = "params == null";
1598 goto exit;
1599 }
1600 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1601 int _needed;
1602 switch (pname) {
1603 #if defined(GL_LIGHT_MODEL_AMBIENT)
1604 case GL_LIGHT_MODEL_AMBIENT:
1605 #endif // defined(GL_LIGHT_MODEL_AMBIENT)
1606 _needed = 4;
1607 break;
1608 default:
1609 _needed = 1;
1610 break;
1611 }
1612 if (_remaining < _needed) {
1613 _exception = 1;
1614 _exceptionType = "java/lang/IllegalArgumentException";
1615 _exceptionMessage = "remaining() < needed";
1616 goto exit;
1617 }
1618 if (params == NULL) {
1619 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1620 params = (GLfixed *) (_paramsBase + _bufferOffset);
1621 }
1622 glLightModelxv(
1623 (GLenum)pname,
1624 (GLfixed *)params
1625 );
1626
1627 exit:
1628 if (_array) {
1629 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
1630 }
1631 if (_exception) {
1632 jniThrowException(_env, _exceptionType, _exceptionMessage);
1633 }
1634 }
1635
1636 /* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
1637 static void
android_glLightf__IIF(JNIEnv * _env,jobject _this,jint light,jint pname,jfloat param)1638 android_glLightf__IIF
1639 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
1640 glLightf(
1641 (GLenum)light,
1642 (GLenum)pname,
1643 (GLfloat)param
1644 );
1645 }
1646
1647 /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1648 static void
android_glLightfv__II_3FI(JNIEnv * _env,jobject _this,jint light,jint pname,jfloatArray params_ref,jint offset)1649 android_glLightfv__II_3FI
1650 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
1651 jint _exception = 0;
1652 const char * _exceptionType = NULL;
1653 const char * _exceptionMessage = NULL;
1654 GLfloat *params_base = (GLfloat *) 0;
1655 jint _remaining;
1656 GLfloat *params = (GLfloat *) 0;
1657
1658 if (!params_ref) {
1659 _exception = 1;
1660 _exceptionType = "java/lang/IllegalArgumentException";
1661 _exceptionMessage = "params == null";
1662 goto exit;
1663 }
1664 if (offset < 0) {
1665 _exception = 1;
1666 _exceptionType = "java/lang/IllegalArgumentException";
1667 _exceptionMessage = "offset < 0";
1668 goto exit;
1669 }
1670 _remaining = _env->GetArrayLength(params_ref) - offset;
1671 int _needed;
1672 switch (pname) {
1673 #if defined(GL_SPOT_DIRECTION)
1674 case GL_SPOT_DIRECTION:
1675 #endif // defined(GL_SPOT_DIRECTION)
1676 _needed = 3;
1677 break;
1678 #if defined(GL_AMBIENT)
1679 case GL_AMBIENT:
1680 #endif // defined(GL_AMBIENT)
1681 #if defined(GL_DIFFUSE)
1682 case GL_DIFFUSE:
1683 #endif // defined(GL_DIFFUSE)
1684 #if defined(GL_SPECULAR)
1685 case GL_SPECULAR:
1686 #endif // defined(GL_SPECULAR)
1687 #if defined(GL_EMISSION)
1688 case GL_EMISSION:
1689 #endif // defined(GL_EMISSION)
1690 _needed = 4;
1691 break;
1692 default:
1693 _needed = 1;
1694 break;
1695 }
1696 if (_remaining < _needed) {
1697 _exception = 1;
1698 _exceptionType = "java/lang/IllegalArgumentException";
1699 _exceptionMessage = "length - offset < needed";
1700 goto exit;
1701 }
1702 params_base = (GLfloat *)
1703 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
1704 params = params_base + offset;
1705
1706 glLightfv(
1707 (GLenum)light,
1708 (GLenum)pname,
1709 (GLfloat *)params
1710 );
1711
1712 exit:
1713 if (params_base) {
1714 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
1715 JNI_ABORT);
1716 }
1717 if (_exception) {
1718 jniThrowException(_env, _exceptionType, _exceptionMessage);
1719 }
1720 }
1721
1722 /* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1723 static void
android_glLightfv__IILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint light,jint pname,jobject params_buf)1724 android_glLightfv__IILjava_nio_FloatBuffer_2
1725 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
1726 jint _exception = 0;
1727 const char * _exceptionType = NULL;
1728 const char * _exceptionMessage = NULL;
1729 jfloatArray _array = (jfloatArray) 0;
1730 jint _bufferOffset = (jint) 0;
1731 jint _remaining;
1732 GLfloat *params = (GLfloat *) 0;
1733
1734 if (!params_buf) {
1735 _exception = 1;
1736 _exceptionType = "java/lang/IllegalArgumentException";
1737 _exceptionMessage = "params == null";
1738 goto exit;
1739 }
1740 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1741 int _needed;
1742 switch (pname) {
1743 #if defined(GL_SPOT_DIRECTION)
1744 case GL_SPOT_DIRECTION:
1745 #endif // defined(GL_SPOT_DIRECTION)
1746 _needed = 3;
1747 break;
1748 #if defined(GL_AMBIENT)
1749 case GL_AMBIENT:
1750 #endif // defined(GL_AMBIENT)
1751 #if defined(GL_DIFFUSE)
1752 case GL_DIFFUSE:
1753 #endif // defined(GL_DIFFUSE)
1754 #if defined(GL_SPECULAR)
1755 case GL_SPECULAR:
1756 #endif // defined(GL_SPECULAR)
1757 #if defined(GL_EMISSION)
1758 case GL_EMISSION:
1759 #endif // defined(GL_EMISSION)
1760 _needed = 4;
1761 break;
1762 default:
1763 _needed = 1;
1764 break;
1765 }
1766 if (_remaining < _needed) {
1767 _exception = 1;
1768 _exceptionType = "java/lang/IllegalArgumentException";
1769 _exceptionMessage = "remaining() < needed";
1770 goto exit;
1771 }
1772 if (params == NULL) {
1773 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1774 params = (GLfloat *) (_paramsBase + _bufferOffset);
1775 }
1776 glLightfv(
1777 (GLenum)light,
1778 (GLenum)pname,
1779 (GLfloat *)params
1780 );
1781
1782 exit:
1783 if (_array) {
1784 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
1785 }
1786 if (_exception) {
1787 jniThrowException(_env, _exceptionType, _exceptionMessage);
1788 }
1789 }
1790
1791 /* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
1792 static void
android_glLightx__III(JNIEnv * _env,jobject _this,jint light,jint pname,jint param)1793 android_glLightx__III
1794 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
1795 glLightx(
1796 (GLenum)light,
1797 (GLenum)pname,
1798 (GLfixed)param
1799 );
1800 }
1801
1802 /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1803 static void
android_glLightxv__II_3II(JNIEnv * _env,jobject _this,jint light,jint pname,jintArray params_ref,jint offset)1804 android_glLightxv__II_3II
1805 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
1806 jint _exception = 0;
1807 const char * _exceptionType = NULL;
1808 const char * _exceptionMessage = NULL;
1809 GLfixed *params_base = (GLfixed *) 0;
1810 jint _remaining;
1811 GLfixed *params = (GLfixed *) 0;
1812
1813 if (!params_ref) {
1814 _exception = 1;
1815 _exceptionType = "java/lang/IllegalArgumentException";
1816 _exceptionMessage = "params == null";
1817 goto exit;
1818 }
1819 if (offset < 0) {
1820 _exception = 1;
1821 _exceptionType = "java/lang/IllegalArgumentException";
1822 _exceptionMessage = "offset < 0";
1823 goto exit;
1824 }
1825 _remaining = _env->GetArrayLength(params_ref) - offset;
1826 int _needed;
1827 switch (pname) {
1828 #if defined(GL_SPOT_DIRECTION)
1829 case GL_SPOT_DIRECTION:
1830 #endif // defined(GL_SPOT_DIRECTION)
1831 _needed = 3;
1832 break;
1833 #if defined(GL_AMBIENT)
1834 case GL_AMBIENT:
1835 #endif // defined(GL_AMBIENT)
1836 #if defined(GL_DIFFUSE)
1837 case GL_DIFFUSE:
1838 #endif // defined(GL_DIFFUSE)
1839 #if defined(GL_SPECULAR)
1840 case GL_SPECULAR:
1841 #endif // defined(GL_SPECULAR)
1842 #if defined(GL_EMISSION)
1843 case GL_EMISSION:
1844 #endif // defined(GL_EMISSION)
1845 _needed = 4;
1846 break;
1847 default:
1848 _needed = 1;
1849 break;
1850 }
1851 if (_remaining < _needed) {
1852 _exception = 1;
1853 _exceptionType = "java/lang/IllegalArgumentException";
1854 _exceptionMessage = "length - offset < needed";
1855 goto exit;
1856 }
1857 params_base = (GLfixed *)
1858 _env->GetIntArrayElements(params_ref, (jboolean *)0);
1859 params = params_base + offset;
1860
1861 glLightxv(
1862 (GLenum)light,
1863 (GLenum)pname,
1864 (GLfixed *)params
1865 );
1866
1867 exit:
1868 if (params_base) {
1869 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1870 JNI_ABORT);
1871 }
1872 if (_exception) {
1873 jniThrowException(_env, _exceptionType, _exceptionMessage);
1874 }
1875 }
1876
1877 /* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1878 static void
android_glLightxv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint light,jint pname,jobject params_buf)1879 android_glLightxv__IILjava_nio_IntBuffer_2
1880 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
1881 jint _exception = 0;
1882 const char * _exceptionType = NULL;
1883 const char * _exceptionMessage = NULL;
1884 jintArray _array = (jintArray) 0;
1885 jint _bufferOffset = (jint) 0;
1886 jint _remaining;
1887 GLfixed *params = (GLfixed *) 0;
1888
1889 if (!params_buf) {
1890 _exception = 1;
1891 _exceptionType = "java/lang/IllegalArgumentException";
1892 _exceptionMessage = "params == null";
1893 goto exit;
1894 }
1895 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1896 int _needed;
1897 switch (pname) {
1898 #if defined(GL_SPOT_DIRECTION)
1899 case GL_SPOT_DIRECTION:
1900 #endif // defined(GL_SPOT_DIRECTION)
1901 _needed = 3;
1902 break;
1903 #if defined(GL_AMBIENT)
1904 case GL_AMBIENT:
1905 #endif // defined(GL_AMBIENT)
1906 #if defined(GL_DIFFUSE)
1907 case GL_DIFFUSE:
1908 #endif // defined(GL_DIFFUSE)
1909 #if defined(GL_SPECULAR)
1910 case GL_SPECULAR:
1911 #endif // defined(GL_SPECULAR)
1912 #if defined(GL_EMISSION)
1913 case GL_EMISSION:
1914 #endif // defined(GL_EMISSION)
1915 _needed = 4;
1916 break;
1917 default:
1918 _needed = 1;
1919 break;
1920 }
1921 if (_remaining < _needed) {
1922 _exception = 1;
1923 _exceptionType = "java/lang/IllegalArgumentException";
1924 _exceptionMessage = "remaining() < needed";
1925 goto exit;
1926 }
1927 if (params == NULL) {
1928 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1929 params = (GLfixed *) (_paramsBase + _bufferOffset);
1930 }
1931 glLightxv(
1932 (GLenum)light,
1933 (GLenum)pname,
1934 (GLfixed *)params
1935 );
1936
1937 exit:
1938 if (_array) {
1939 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
1940 }
1941 if (_exception) {
1942 jniThrowException(_env, _exceptionType, _exceptionMessage);
1943 }
1944 }
1945
1946 /* void glLineWidth ( GLfloat width ) */
1947 static void
android_glLineWidth__F(JNIEnv * _env,jobject _this,jfloat width)1948 android_glLineWidth__F
1949 (JNIEnv *_env, jobject _this, jfloat width) {
1950 glLineWidth(
1951 (GLfloat)width
1952 );
1953 }
1954
1955 /* void glLineWidthx ( GLfixed width ) */
1956 static void
android_glLineWidthx__I(JNIEnv * _env,jobject _this,jint width)1957 android_glLineWidthx__I
1958 (JNIEnv *_env, jobject _this, jint width) {
1959 glLineWidthx(
1960 (GLfixed)width
1961 );
1962 }
1963
1964 /* void glLoadIdentity ( void ) */
1965 static void
android_glLoadIdentity__(JNIEnv * _env,jobject _this)1966 android_glLoadIdentity__
1967 (JNIEnv *_env, jobject _this) {
1968 glLoadIdentity();
1969 }
1970
1971 /* void glLoadMatrixf ( const GLfloat *m ) */
1972 static void
android_glLoadMatrixf___3FI(JNIEnv * _env,jobject _this,jfloatArray m_ref,jint offset)1973 android_glLoadMatrixf___3FI
1974 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
1975 jint _exception = 0;
1976 const char * _exceptionType = NULL;
1977 const char * _exceptionMessage = NULL;
1978 GLfloat *m_base = (GLfloat *) 0;
1979 jint _remaining;
1980 GLfloat *m = (GLfloat *) 0;
1981
1982 if (!m_ref) {
1983 _exception = 1;
1984 _exceptionType = "java/lang/IllegalArgumentException";
1985 _exceptionMessage = "m == null";
1986 goto exit;
1987 }
1988 if (offset < 0) {
1989 _exception = 1;
1990 _exceptionType = "java/lang/IllegalArgumentException";
1991 _exceptionMessage = "offset < 0";
1992 goto exit;
1993 }
1994 _remaining = _env->GetArrayLength(m_ref) - offset;
1995 m_base = (GLfloat *)
1996 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
1997 m = m_base + offset;
1998
1999 glLoadMatrixf(
2000 (GLfloat *)m
2001 );
2002
2003 exit:
2004 if (m_base) {
2005 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
2006 JNI_ABORT);
2007 }
2008 if (_exception) {
2009 jniThrowException(_env, _exceptionType, _exceptionMessage);
2010 }
2011 }
2012
2013 /* void glLoadMatrixf ( const GLfloat *m ) */
2014 static void
android_glLoadMatrixf__Ljava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jobject m_buf)2015 android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
2016 (JNIEnv *_env, jobject _this, jobject m_buf) {
2017 jint _exception = 0;
2018 const char * _exceptionType = NULL;
2019 const char * _exceptionMessage = NULL;
2020 jfloatArray _array = (jfloatArray) 0;
2021 jint _bufferOffset = (jint) 0;
2022 jint _remaining;
2023 GLfloat *m = (GLfloat *) 0;
2024
2025 if (!m_buf) {
2026 _exception = 1;
2027 _exceptionType = "java/lang/IllegalArgumentException";
2028 _exceptionMessage = "m == null";
2029 goto exit;
2030 }
2031 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2032 if (m == NULL) {
2033 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2034 m = (GLfloat *) (_mBase + _bufferOffset);
2035 }
2036 glLoadMatrixf(
2037 (GLfloat *)m
2038 );
2039
2040 exit:
2041 if (_array) {
2042 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
2043 }
2044 if (_exception) {
2045 jniThrowException(_env, _exceptionType, _exceptionMessage);
2046 }
2047 }
2048
2049 /* void glLoadMatrixx ( const GLfixed *m ) */
2050 static void
android_glLoadMatrixx___3II(JNIEnv * _env,jobject _this,jintArray m_ref,jint offset)2051 android_glLoadMatrixx___3II
2052 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
2053 jint _exception = 0;
2054 const char * _exceptionType = NULL;
2055 const char * _exceptionMessage = NULL;
2056 GLfixed *m_base = (GLfixed *) 0;
2057 jint _remaining;
2058 GLfixed *m = (GLfixed *) 0;
2059
2060 if (!m_ref) {
2061 _exception = 1;
2062 _exceptionType = "java/lang/IllegalArgumentException";
2063 _exceptionMessage = "m == null";
2064 goto exit;
2065 }
2066 if (offset < 0) {
2067 _exception = 1;
2068 _exceptionType = "java/lang/IllegalArgumentException";
2069 _exceptionMessage = "offset < 0";
2070 goto exit;
2071 }
2072 _remaining = _env->GetArrayLength(m_ref) - offset;
2073 m_base = (GLfixed *)
2074 _env->GetIntArrayElements(m_ref, (jboolean *)0);
2075 m = m_base + offset;
2076
2077 glLoadMatrixx(
2078 (GLfixed *)m
2079 );
2080
2081 exit:
2082 if (m_base) {
2083 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
2084 JNI_ABORT);
2085 }
2086 if (_exception) {
2087 jniThrowException(_env, _exceptionType, _exceptionMessage);
2088 }
2089 }
2090
2091 /* void glLoadMatrixx ( const GLfixed *m ) */
2092 static void
android_glLoadMatrixx__Ljava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jobject m_buf)2093 android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2094 (JNIEnv *_env, jobject _this, jobject m_buf) {
2095 jint _exception = 0;
2096 const char * _exceptionType = NULL;
2097 const char * _exceptionMessage = NULL;
2098 jintArray _array = (jintArray) 0;
2099 jint _bufferOffset = (jint) 0;
2100 jint _remaining;
2101 GLfixed *m = (GLfixed *) 0;
2102
2103 if (!m_buf) {
2104 _exception = 1;
2105 _exceptionType = "java/lang/IllegalArgumentException";
2106 _exceptionMessage = "m == null";
2107 goto exit;
2108 }
2109 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2110 if (m == NULL) {
2111 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2112 m = (GLfixed *) (_mBase + _bufferOffset);
2113 }
2114 glLoadMatrixx(
2115 (GLfixed *)m
2116 );
2117
2118 exit:
2119 if (_array) {
2120 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
2121 }
2122 if (_exception) {
2123 jniThrowException(_env, _exceptionType, _exceptionMessage);
2124 }
2125 }
2126
2127 /* void glLogicOp ( GLenum opcode ) */
2128 static void
android_glLogicOp__I(JNIEnv * _env,jobject _this,jint opcode)2129 android_glLogicOp__I
2130 (JNIEnv *_env, jobject _this, jint opcode) {
2131 glLogicOp(
2132 (GLenum)opcode
2133 );
2134 }
2135
2136 /* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2137 static void
android_glMaterialf__IIF(JNIEnv * _env,jobject _this,jint face,jint pname,jfloat param)2138 android_glMaterialf__IIF
2139 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2140 glMaterialf(
2141 (GLenum)face,
2142 (GLenum)pname,
2143 (GLfloat)param
2144 );
2145 }
2146
2147 /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2148 static void
android_glMaterialfv__II_3FI(JNIEnv * _env,jobject _this,jint face,jint pname,jfloatArray params_ref,jint offset)2149 android_glMaterialfv__II_3FI
2150 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
2151 jint _exception = 0;
2152 const char * _exceptionType = NULL;
2153 const char * _exceptionMessage = NULL;
2154 GLfloat *params_base = (GLfloat *) 0;
2155 jint _remaining;
2156 GLfloat *params = (GLfloat *) 0;
2157
2158 if (!params_ref) {
2159 _exception = 1;
2160 _exceptionType = "java/lang/IllegalArgumentException";
2161 _exceptionMessage = "params == null";
2162 goto exit;
2163 }
2164 if (offset < 0) {
2165 _exception = 1;
2166 _exceptionType = "java/lang/IllegalArgumentException";
2167 _exceptionMessage = "offset < 0";
2168 goto exit;
2169 }
2170 _remaining = _env->GetArrayLength(params_ref) - offset;
2171 int _needed;
2172 switch (pname) {
2173 #if defined(GL_AMBIENT)
2174 case GL_AMBIENT:
2175 #endif // defined(GL_AMBIENT)
2176 #if defined(GL_DIFFUSE)
2177 case GL_DIFFUSE:
2178 #endif // defined(GL_DIFFUSE)
2179 #if defined(GL_SPECULAR)
2180 case GL_SPECULAR:
2181 #endif // defined(GL_SPECULAR)
2182 #if defined(GL_EMISSION)
2183 case GL_EMISSION:
2184 #endif // defined(GL_EMISSION)
2185 #if defined(GL_AMBIENT_AND_DIFFUSE)
2186 case GL_AMBIENT_AND_DIFFUSE:
2187 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
2188 _needed = 4;
2189 break;
2190 default:
2191 _needed = 1;
2192 break;
2193 }
2194 if (_remaining < _needed) {
2195 _exception = 1;
2196 _exceptionType = "java/lang/IllegalArgumentException";
2197 _exceptionMessage = "length - offset < needed";
2198 goto exit;
2199 }
2200 params_base = (GLfloat *)
2201 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
2202 params = params_base + offset;
2203
2204 glMaterialfv(
2205 (GLenum)face,
2206 (GLenum)pname,
2207 (GLfloat *)params
2208 );
2209
2210 exit:
2211 if (params_base) {
2212 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
2213 JNI_ABORT);
2214 }
2215 if (_exception) {
2216 jniThrowException(_env, _exceptionType, _exceptionMessage);
2217 }
2218 }
2219
2220 /* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2221 static void
android_glMaterialfv__IILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint face,jint pname,jobject params_buf)2222 android_glMaterialfv__IILjava_nio_FloatBuffer_2
2223 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
2224 jint _exception = 0;
2225 const char * _exceptionType = NULL;
2226 const char * _exceptionMessage = NULL;
2227 jfloatArray _array = (jfloatArray) 0;
2228 jint _bufferOffset = (jint) 0;
2229 jint _remaining;
2230 GLfloat *params = (GLfloat *) 0;
2231
2232 if (!params_buf) {
2233 _exception = 1;
2234 _exceptionType = "java/lang/IllegalArgumentException";
2235 _exceptionMessage = "params == null";
2236 goto exit;
2237 }
2238 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2239 int _needed;
2240 switch (pname) {
2241 #if defined(GL_AMBIENT)
2242 case GL_AMBIENT:
2243 #endif // defined(GL_AMBIENT)
2244 #if defined(GL_DIFFUSE)
2245 case GL_DIFFUSE:
2246 #endif // defined(GL_DIFFUSE)
2247 #if defined(GL_SPECULAR)
2248 case GL_SPECULAR:
2249 #endif // defined(GL_SPECULAR)
2250 #if defined(GL_EMISSION)
2251 case GL_EMISSION:
2252 #endif // defined(GL_EMISSION)
2253 #if defined(GL_AMBIENT_AND_DIFFUSE)
2254 case GL_AMBIENT_AND_DIFFUSE:
2255 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
2256 _needed = 4;
2257 break;
2258 default:
2259 _needed = 1;
2260 break;
2261 }
2262 if (_remaining < _needed) {
2263 _exception = 1;
2264 _exceptionType = "java/lang/IllegalArgumentException";
2265 _exceptionMessage = "remaining() < needed";
2266 goto exit;
2267 }
2268 if (params == NULL) {
2269 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2270 params = (GLfloat *) (_paramsBase + _bufferOffset);
2271 }
2272 glMaterialfv(
2273 (GLenum)face,
2274 (GLenum)pname,
2275 (GLfloat *)params
2276 );
2277
2278 exit:
2279 if (_array) {
2280 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
2281 }
2282 if (_exception) {
2283 jniThrowException(_env, _exceptionType, _exceptionMessage);
2284 }
2285 }
2286
2287 /* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
2288 static void
android_glMaterialx__III(JNIEnv * _env,jobject _this,jint face,jint pname,jint param)2289 android_glMaterialx__III
2290 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
2291 glMaterialx(
2292 (GLenum)face,
2293 (GLenum)pname,
2294 (GLfixed)param
2295 );
2296 }
2297
2298 /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2299 static void
android_glMaterialxv__II_3II(JNIEnv * _env,jobject _this,jint face,jint pname,jintArray params_ref,jint offset)2300 android_glMaterialxv__II_3II
2301 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
2302 jint _exception = 0;
2303 const char * _exceptionType = NULL;
2304 const char * _exceptionMessage = NULL;
2305 GLfixed *params_base = (GLfixed *) 0;
2306 jint _remaining;
2307 GLfixed *params = (GLfixed *) 0;
2308
2309 if (!params_ref) {
2310 _exception = 1;
2311 _exceptionType = "java/lang/IllegalArgumentException";
2312 _exceptionMessage = "params == null";
2313 goto exit;
2314 }
2315 if (offset < 0) {
2316 _exception = 1;
2317 _exceptionType = "java/lang/IllegalArgumentException";
2318 _exceptionMessage = "offset < 0";
2319 goto exit;
2320 }
2321 _remaining = _env->GetArrayLength(params_ref) - offset;
2322 int _needed;
2323 switch (pname) {
2324 #if defined(GL_AMBIENT)
2325 case GL_AMBIENT:
2326 #endif // defined(GL_AMBIENT)
2327 #if defined(GL_DIFFUSE)
2328 case GL_DIFFUSE:
2329 #endif // defined(GL_DIFFUSE)
2330 #if defined(GL_SPECULAR)
2331 case GL_SPECULAR:
2332 #endif // defined(GL_SPECULAR)
2333 #if defined(GL_EMISSION)
2334 case GL_EMISSION:
2335 #endif // defined(GL_EMISSION)
2336 #if defined(GL_AMBIENT_AND_DIFFUSE)
2337 case GL_AMBIENT_AND_DIFFUSE:
2338 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
2339 _needed = 4;
2340 break;
2341 default:
2342 _needed = 1;
2343 break;
2344 }
2345 if (_remaining < _needed) {
2346 _exception = 1;
2347 _exceptionType = "java/lang/IllegalArgumentException";
2348 _exceptionMessage = "length - offset < needed";
2349 goto exit;
2350 }
2351 params_base = (GLfixed *)
2352 _env->GetIntArrayElements(params_ref, (jboolean *)0);
2353 params = params_base + offset;
2354
2355 glMaterialxv(
2356 (GLenum)face,
2357 (GLenum)pname,
2358 (GLfixed *)params
2359 );
2360
2361 exit:
2362 if (params_base) {
2363 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
2364 JNI_ABORT);
2365 }
2366 if (_exception) {
2367 jniThrowException(_env, _exceptionType, _exceptionMessage);
2368 }
2369 }
2370
2371 /* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2372 static void
android_glMaterialxv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint face,jint pname,jobject params_buf)2373 android_glMaterialxv__IILjava_nio_IntBuffer_2
2374 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
2375 jint _exception = 0;
2376 const char * _exceptionType = NULL;
2377 const char * _exceptionMessage = NULL;
2378 jintArray _array = (jintArray) 0;
2379 jint _bufferOffset = (jint) 0;
2380 jint _remaining;
2381 GLfixed *params = (GLfixed *) 0;
2382
2383 if (!params_buf) {
2384 _exception = 1;
2385 _exceptionType = "java/lang/IllegalArgumentException";
2386 _exceptionMessage = "params == null";
2387 goto exit;
2388 }
2389 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2390 int _needed;
2391 switch (pname) {
2392 #if defined(GL_AMBIENT)
2393 case GL_AMBIENT:
2394 #endif // defined(GL_AMBIENT)
2395 #if defined(GL_DIFFUSE)
2396 case GL_DIFFUSE:
2397 #endif // defined(GL_DIFFUSE)
2398 #if defined(GL_SPECULAR)
2399 case GL_SPECULAR:
2400 #endif // defined(GL_SPECULAR)
2401 #if defined(GL_EMISSION)
2402 case GL_EMISSION:
2403 #endif // defined(GL_EMISSION)
2404 #if defined(GL_AMBIENT_AND_DIFFUSE)
2405 case GL_AMBIENT_AND_DIFFUSE:
2406 #endif // defined(GL_AMBIENT_AND_DIFFUSE)
2407 _needed = 4;
2408 break;
2409 default:
2410 _needed = 1;
2411 break;
2412 }
2413 if (_remaining < _needed) {
2414 _exception = 1;
2415 _exceptionType = "java/lang/IllegalArgumentException";
2416 _exceptionMessage = "remaining() < needed";
2417 goto exit;
2418 }
2419 if (params == NULL) {
2420 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2421 params = (GLfixed *) (_paramsBase + _bufferOffset);
2422 }
2423 glMaterialxv(
2424 (GLenum)face,
2425 (GLenum)pname,
2426 (GLfixed *)params
2427 );
2428
2429 exit:
2430 if (_array) {
2431 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
2432 }
2433 if (_exception) {
2434 jniThrowException(_env, _exceptionType, _exceptionMessage);
2435 }
2436 }
2437
2438 /* void glMatrixMode ( GLenum mode ) */
2439 static void
android_glMatrixMode__I(JNIEnv * _env,jobject _this,jint mode)2440 android_glMatrixMode__I
2441 (JNIEnv *_env, jobject _this, jint mode) {
2442 glMatrixMode(
2443 (GLenum)mode
2444 );
2445 }
2446
2447 /* void glMultMatrixf ( const GLfloat *m ) */
2448 static void
android_glMultMatrixf___3FI(JNIEnv * _env,jobject _this,jfloatArray m_ref,jint offset)2449 android_glMultMatrixf___3FI
2450 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
2451 jint _exception = 0;
2452 const char * _exceptionType = NULL;
2453 const char * _exceptionMessage = NULL;
2454 GLfloat *m_base = (GLfloat *) 0;
2455 jint _remaining;
2456 GLfloat *m = (GLfloat *) 0;
2457
2458 if (!m_ref) {
2459 _exception = 1;
2460 _exceptionType = "java/lang/IllegalArgumentException";
2461 _exceptionMessage = "m == null";
2462 goto exit;
2463 }
2464 if (offset < 0) {
2465 _exception = 1;
2466 _exceptionType = "java/lang/IllegalArgumentException";
2467 _exceptionMessage = "offset < 0";
2468 goto exit;
2469 }
2470 _remaining = _env->GetArrayLength(m_ref) - offset;
2471 m_base = (GLfloat *)
2472 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
2473 m = m_base + offset;
2474
2475 glMultMatrixf(
2476 (GLfloat *)m
2477 );
2478
2479 exit:
2480 if (m_base) {
2481 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
2482 JNI_ABORT);
2483 }
2484 if (_exception) {
2485 jniThrowException(_env, _exceptionType, _exceptionMessage);
2486 }
2487 }
2488
2489 /* void glMultMatrixf ( const GLfloat *m ) */
2490 static void
android_glMultMatrixf__Ljava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jobject m_buf)2491 android_glMultMatrixf__Ljava_nio_FloatBuffer_2
2492 (JNIEnv *_env, jobject _this, jobject m_buf) {
2493 jint _exception = 0;
2494 const char * _exceptionType = NULL;
2495 const char * _exceptionMessage = NULL;
2496 jfloatArray _array = (jfloatArray) 0;
2497 jint _bufferOffset = (jint) 0;
2498 jint _remaining;
2499 GLfloat *m = (GLfloat *) 0;
2500
2501 if (!m_buf) {
2502 _exception = 1;
2503 _exceptionType = "java/lang/IllegalArgumentException";
2504 _exceptionMessage = "m == null";
2505 goto exit;
2506 }
2507 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2508 if (m == NULL) {
2509 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2510 m = (GLfloat *) (_mBase + _bufferOffset);
2511 }
2512 glMultMatrixf(
2513 (GLfloat *)m
2514 );
2515
2516 exit:
2517 if (_array) {
2518 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
2519 }
2520 if (_exception) {
2521 jniThrowException(_env, _exceptionType, _exceptionMessage);
2522 }
2523 }
2524
2525 /* void glMultMatrixx ( const GLfixed *m ) */
2526 static void
android_glMultMatrixx___3II(JNIEnv * _env,jobject _this,jintArray m_ref,jint offset)2527 android_glMultMatrixx___3II
2528 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
2529 jint _exception = 0;
2530 const char * _exceptionType = NULL;
2531 const char * _exceptionMessage = NULL;
2532 GLfixed *m_base = (GLfixed *) 0;
2533 jint _remaining;
2534 GLfixed *m = (GLfixed *) 0;
2535
2536 if (!m_ref) {
2537 _exception = 1;
2538 _exceptionType = "java/lang/IllegalArgumentException";
2539 _exceptionMessage = "m == null";
2540 goto exit;
2541 }
2542 if (offset < 0) {
2543 _exception = 1;
2544 _exceptionType = "java/lang/IllegalArgumentException";
2545 _exceptionMessage = "offset < 0";
2546 goto exit;
2547 }
2548 _remaining = _env->GetArrayLength(m_ref) - offset;
2549 m_base = (GLfixed *)
2550 _env->GetIntArrayElements(m_ref, (jboolean *)0);
2551 m = m_base + offset;
2552
2553 glMultMatrixx(
2554 (GLfixed *)m
2555 );
2556
2557 exit:
2558 if (m_base) {
2559 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
2560 JNI_ABORT);
2561 }
2562 if (_exception) {
2563 jniThrowException(_env, _exceptionType, _exceptionMessage);
2564 }
2565 }
2566
2567 /* void glMultMatrixx ( const GLfixed *m ) */
2568 static void
android_glMultMatrixx__Ljava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jobject m_buf)2569 android_glMultMatrixx__Ljava_nio_IntBuffer_2
2570 (JNIEnv *_env, jobject _this, jobject m_buf) {
2571 jint _exception = 0;
2572 const char * _exceptionType = NULL;
2573 const char * _exceptionMessage = NULL;
2574 jintArray _array = (jintArray) 0;
2575 jint _bufferOffset = (jint) 0;
2576 jint _remaining;
2577 GLfixed *m = (GLfixed *) 0;
2578
2579 if (!m_buf) {
2580 _exception = 1;
2581 _exceptionType = "java/lang/IllegalArgumentException";
2582 _exceptionMessage = "m == null";
2583 goto exit;
2584 }
2585 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2586 if (m == NULL) {
2587 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2588 m = (GLfixed *) (_mBase + _bufferOffset);
2589 }
2590 glMultMatrixx(
2591 (GLfixed *)m
2592 );
2593
2594 exit:
2595 if (_array) {
2596 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
2597 }
2598 if (_exception) {
2599 jniThrowException(_env, _exceptionType, _exceptionMessage);
2600 }
2601 }
2602
2603 /* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
2604 static void
android_glMultiTexCoord4f__IFFFF(JNIEnv * _env,jobject _this,jint target,jfloat s,jfloat t,jfloat r,jfloat q)2605 android_glMultiTexCoord4f__IFFFF
2606 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
2607 glMultiTexCoord4f(
2608 (GLenum)target,
2609 (GLfloat)s,
2610 (GLfloat)t,
2611 (GLfloat)r,
2612 (GLfloat)q
2613 );
2614 }
2615
2616 /* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
2617 static void
android_glMultiTexCoord4x__IIIII(JNIEnv * _env,jobject _this,jint target,jint s,jint t,jint r,jint q)2618 android_glMultiTexCoord4x__IIIII
2619 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
2620 glMultiTexCoord4x(
2621 (GLenum)target,
2622 (GLfixed)s,
2623 (GLfixed)t,
2624 (GLfixed)r,
2625 (GLfixed)q
2626 );
2627 }
2628
2629 /* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
2630 static void
android_glNormal3f__FFF(JNIEnv * _env,jobject _this,jfloat nx,jfloat ny,jfloat nz)2631 android_glNormal3f__FFF
2632 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
2633 glNormal3f(
2634 (GLfloat)nx,
2635 (GLfloat)ny,
2636 (GLfloat)nz
2637 );
2638 }
2639
2640 /* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
2641 static void
android_glNormal3x__III(JNIEnv * _env,jobject _this,jint nx,jint ny,jint nz)2642 android_glNormal3x__III
2643 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
2644 glNormal3x(
2645 (GLfixed)nx,
2646 (GLfixed)ny,
2647 (GLfixed)nz
2648 );
2649 }
2650
2651 /* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
2652 static void
android_glNormalPointerBounds__IILjava_nio_Buffer_2I(JNIEnv * _env,jobject _this,jint type,jint stride,jobject pointer_buf,jint remaining)2653 android_glNormalPointerBounds__IILjava_nio_Buffer_2I
2654 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
2655 jint _exception = 0;
2656 const char * _exceptionType = NULL;
2657 const char * _exceptionMessage = NULL;
2658 jarray _array = (jarray) 0;
2659 jint _bufferOffset = (jint) 0;
2660 jint _remaining;
2661 GLvoid *pointer = (GLvoid *) 0;
2662
2663 if (pointer_buf) {
2664 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2665 if ( ! pointer ) {
2666 return;
2667 }
2668 }
2669 glNormalPointerBounds(
2670 (GLenum)type,
2671 (GLsizei)stride,
2672 (GLvoid *)pointer,
2673 (GLsizei)remaining
2674 );
2675 if (_exception) {
2676 jniThrowException(_env, _exceptionType, _exceptionMessage);
2677 }
2678 }
2679
2680 /* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
2681 static void
android_glOrthof__FFFFFF(JNIEnv * _env,jobject _this,jfloat left,jfloat right,jfloat bottom,jfloat top,jfloat zNear,jfloat zFar)2682 android_glOrthof__FFFFFF
2683 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
2684 glOrthof(
2685 (GLfloat)left,
2686 (GLfloat)right,
2687 (GLfloat)bottom,
2688 (GLfloat)top,
2689 (GLfloat)zNear,
2690 (GLfloat)zFar
2691 );
2692 }
2693
2694 /* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
2695 static void
android_glOrthox__IIIIII(JNIEnv * _env,jobject _this,jint left,jint right,jint bottom,jint top,jint zNear,jint zFar)2696 android_glOrthox__IIIIII
2697 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
2698 glOrthox(
2699 (GLfixed)left,
2700 (GLfixed)right,
2701 (GLfixed)bottom,
2702 (GLfixed)top,
2703 (GLfixed)zNear,
2704 (GLfixed)zFar
2705 );
2706 }
2707
2708 /* void glPixelStorei ( GLenum pname, GLint param ) */
2709 static void
android_glPixelStorei__II(JNIEnv * _env,jobject _this,jint pname,jint param)2710 android_glPixelStorei__II
2711 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2712 glPixelStorei(
2713 (GLenum)pname,
2714 (GLint)param
2715 );
2716 }
2717
2718 /* void glPointSize ( GLfloat size ) */
2719 static void
android_glPointSize__F(JNIEnv * _env,jobject _this,jfloat size)2720 android_glPointSize__F
2721 (JNIEnv *_env, jobject _this, jfloat size) {
2722 glPointSize(
2723 (GLfloat)size
2724 );
2725 }
2726
2727 /* void glPointSizex ( GLfixed size ) */
2728 static void
android_glPointSizex__I(JNIEnv * _env,jobject _this,jint size)2729 android_glPointSizex__I
2730 (JNIEnv *_env, jobject _this, jint size) {
2731 glPointSizex(
2732 (GLfixed)size
2733 );
2734 }
2735
2736 /* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
2737 static void
android_glPolygonOffset__FF(JNIEnv * _env,jobject _this,jfloat factor,jfloat units)2738 android_glPolygonOffset__FF
2739 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
2740 glPolygonOffset(
2741 (GLfloat)factor,
2742 (GLfloat)units
2743 );
2744 }
2745
2746 /* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
2747 static void
android_glPolygonOffsetx__II(JNIEnv * _env,jobject _this,jint factor,jint units)2748 android_glPolygonOffsetx__II
2749 (JNIEnv *_env, jobject _this, jint factor, jint units) {
2750 glPolygonOffsetx(
2751 (GLfixed)factor,
2752 (GLfixed)units
2753 );
2754 }
2755
2756 /* void glPopMatrix ( void ) */
2757 static void
android_glPopMatrix__(JNIEnv * _env,jobject _this)2758 android_glPopMatrix__
2759 (JNIEnv *_env, jobject _this) {
2760 glPopMatrix();
2761 }
2762
2763 /* void glPushMatrix ( void ) */
2764 static void
android_glPushMatrix__(JNIEnv * _env,jobject _this)2765 android_glPushMatrix__
2766 (JNIEnv *_env, jobject _this) {
2767 glPushMatrix();
2768 }
2769
2770 /* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
2771 static void
android_glReadPixels__IIIIIILjava_nio_Buffer_2(JNIEnv * _env,jobject _this,jint x,jint y,jint width,jint height,jint format,jint type,jobject pixels_buf)2772 android_glReadPixels__IIIIIILjava_nio_Buffer_2
2773 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
2774 jint _exception = 0;
2775 const char * _exceptionType = NULL;
2776 const char * _exceptionMessage = NULL;
2777 jarray _array = (jarray) 0;
2778 jint _bufferOffset = (jint) 0;
2779 jint _remaining;
2780 GLvoid *pixels = (GLvoid *) 0;
2781
2782 if (!pixels_buf) {
2783 _exception = 1;
2784 _exceptionType = "java/lang/IllegalArgumentException";
2785 _exceptionMessage = "pixels == null";
2786 goto exit;
2787 }
2788 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2789 if (pixels == NULL) {
2790 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2791 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
2792 }
2793 glReadPixels(
2794 (GLint)x,
2795 (GLint)y,
2796 (GLsizei)width,
2797 (GLsizei)height,
2798 (GLenum)format,
2799 (GLenum)type,
2800 (GLvoid *)pixels
2801 );
2802
2803 exit:
2804 if (_array) {
2805 releasePointer(_env, _array, (void *)((char *)pixels - _bufferOffset),
2806 _exception ? JNI_FALSE : JNI_TRUE);
2807 }
2808 if (_exception) {
2809 jniThrowException(_env, _exceptionType, _exceptionMessage);
2810 }
2811 }
2812
2813 /* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
2814 static void
android_glRotatef__FFFF(JNIEnv * _env,jobject _this,jfloat angle,jfloat x,jfloat y,jfloat z)2815 android_glRotatef__FFFF
2816 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
2817 glRotatef(
2818 (GLfloat)angle,
2819 (GLfloat)x,
2820 (GLfloat)y,
2821 (GLfloat)z
2822 );
2823 }
2824
2825 /* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
2826 static void
android_glRotatex__IIII(JNIEnv * _env,jobject _this,jint angle,jint x,jint y,jint z)2827 android_glRotatex__IIII
2828 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
2829 glRotatex(
2830 (GLfixed)angle,
2831 (GLfixed)x,
2832 (GLfixed)y,
2833 (GLfixed)z
2834 );
2835 }
2836
2837 /* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
2838 static void
android_glSampleCoverage__FZ(JNIEnv * _env,jobject _this,jfloat value,jboolean invert)2839 android_glSampleCoverage__FZ
2840 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
2841 glSampleCoverage(
2842 (GLclampf)value,
2843 (GLboolean)invert
2844 );
2845 }
2846
2847 /* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
2848 static void
android_glSampleCoveragex__IZ(JNIEnv * _env,jobject _this,jint value,jboolean invert)2849 android_glSampleCoveragex__IZ
2850 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
2851 glSampleCoveragex(
2852 (GLclampx)value,
2853 (GLboolean)invert
2854 );
2855 }
2856
2857 /* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
2858 static void
android_glScalef__FFF(JNIEnv * _env,jobject _this,jfloat x,jfloat y,jfloat z)2859 android_glScalef__FFF
2860 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
2861 glScalef(
2862 (GLfloat)x,
2863 (GLfloat)y,
2864 (GLfloat)z
2865 );
2866 }
2867
2868 /* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
2869 static void
android_glScalex__III(JNIEnv * _env,jobject _this,jint x,jint y,jint z)2870 android_glScalex__III
2871 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
2872 glScalex(
2873 (GLfixed)x,
2874 (GLfixed)y,
2875 (GLfixed)z
2876 );
2877 }
2878
2879 /* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
2880 static void
android_glScissor__IIII(JNIEnv * _env,jobject _this,jint x,jint y,jint width,jint height)2881 android_glScissor__IIII
2882 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
2883 glScissor(
2884 (GLint)x,
2885 (GLint)y,
2886 (GLsizei)width,
2887 (GLsizei)height
2888 );
2889 }
2890
2891 /* void glShadeModel ( GLenum mode ) */
2892 static void
android_glShadeModel__I(JNIEnv * _env,jobject _this,jint mode)2893 android_glShadeModel__I
2894 (JNIEnv *_env, jobject _this, jint mode) {
2895 glShadeModel(
2896 (GLenum)mode
2897 );
2898 }
2899
2900 /* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
2901 static void
android_glStencilFunc__III(JNIEnv * _env,jobject _this,jint func,jint ref,jint mask)2902 android_glStencilFunc__III
2903 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
2904 glStencilFunc(
2905 (GLenum)func,
2906 (GLint)ref,
2907 (GLuint)mask
2908 );
2909 }
2910
2911 /* void glStencilMask ( GLuint mask ) */
2912 static void
android_glStencilMask__I(JNIEnv * _env,jobject _this,jint mask)2913 android_glStencilMask__I
2914 (JNIEnv *_env, jobject _this, jint mask) {
2915 glStencilMask(
2916 (GLuint)mask
2917 );
2918 }
2919
2920 /* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
2921 static void
android_glStencilOp__III(JNIEnv * _env,jobject _this,jint fail,jint zfail,jint zpass)2922 android_glStencilOp__III
2923 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
2924 glStencilOp(
2925 (GLenum)fail,
2926 (GLenum)zfail,
2927 (GLenum)zpass
2928 );
2929 }
2930
2931 /* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2932 static void
android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I(JNIEnv * _env,jobject _this,jint size,jint type,jint stride,jobject pointer_buf,jint remaining)2933 android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
2934 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
2935 jint _exception = 0;
2936 const char * _exceptionType = NULL;
2937 const char * _exceptionMessage = NULL;
2938 jarray _array = (jarray) 0;
2939 jint _bufferOffset = (jint) 0;
2940 jint _remaining;
2941 GLvoid *pointer = (GLvoid *) 0;
2942
2943 if (pointer_buf) {
2944 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
2945 if ( ! pointer ) {
2946 return;
2947 }
2948 }
2949 glTexCoordPointerBounds(
2950 (GLint)size,
2951 (GLenum)type,
2952 (GLsizei)stride,
2953 (GLvoid *)pointer,
2954 (GLsizei)remaining
2955 );
2956 if (_exception) {
2957 jniThrowException(_env, _exceptionType, _exceptionMessage);
2958 }
2959 }
2960
2961 /* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
2962 static void
android_glTexEnvf__IIF(JNIEnv * _env,jobject _this,jint target,jint pname,jfloat param)2963 android_glTexEnvf__IIF
2964 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
2965 glTexEnvf(
2966 (GLenum)target,
2967 (GLenum)pname,
2968 (GLfloat)param
2969 );
2970 }
2971
2972 /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2973 static void
android_glTexEnvfv__II_3FI(JNIEnv * _env,jobject _this,jint target,jint pname,jfloatArray params_ref,jint offset)2974 android_glTexEnvfv__II_3FI
2975 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
2976 jint _exception = 0;
2977 const char * _exceptionType = NULL;
2978 const char * _exceptionMessage = NULL;
2979 GLfloat *params_base = (GLfloat *) 0;
2980 jint _remaining;
2981 GLfloat *params = (GLfloat *) 0;
2982
2983 if (!params_ref) {
2984 _exception = 1;
2985 _exceptionType = "java/lang/IllegalArgumentException";
2986 _exceptionMessage = "params == null";
2987 goto exit;
2988 }
2989 if (offset < 0) {
2990 _exception = 1;
2991 _exceptionType = "java/lang/IllegalArgumentException";
2992 _exceptionMessage = "offset < 0";
2993 goto exit;
2994 }
2995 _remaining = _env->GetArrayLength(params_ref) - offset;
2996 int _needed;
2997 switch (pname) {
2998 #if defined(GL_TEXTURE_ENV_COLOR)
2999 case GL_TEXTURE_ENV_COLOR:
3000 #endif // defined(GL_TEXTURE_ENV_COLOR)
3001 _needed = 4;
3002 break;
3003 default:
3004 _needed = 1;
3005 break;
3006 }
3007 if (_remaining < _needed) {
3008 _exception = 1;
3009 _exceptionType = "java/lang/IllegalArgumentException";
3010 _exceptionMessage = "length - offset < needed";
3011 goto exit;
3012 }
3013 params_base = (GLfloat *)
3014 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
3015 params = params_base + offset;
3016
3017 glTexEnvfv(
3018 (GLenum)target,
3019 (GLenum)pname,
3020 (GLfloat *)params
3021 );
3022
3023 exit:
3024 if (params_base) {
3025 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
3026 JNI_ABORT);
3027 }
3028 if (_exception) {
3029 jniThrowException(_env, _exceptionType, _exceptionMessage);
3030 }
3031 }
3032
3033 /* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3034 static void
android_glTexEnvfv__IILjava_nio_FloatBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)3035 android_glTexEnvfv__IILjava_nio_FloatBuffer_2
3036 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
3037 jint _exception = 0;
3038 const char * _exceptionType = NULL;
3039 const char * _exceptionMessage = NULL;
3040 jfloatArray _array = (jfloatArray) 0;
3041 jint _bufferOffset = (jint) 0;
3042 jint _remaining;
3043 GLfloat *params = (GLfloat *) 0;
3044
3045 if (!params_buf) {
3046 _exception = 1;
3047 _exceptionType = "java/lang/IllegalArgumentException";
3048 _exceptionMessage = "params == null";
3049 goto exit;
3050 }
3051 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3052 int _needed;
3053 switch (pname) {
3054 #if defined(GL_TEXTURE_ENV_COLOR)
3055 case GL_TEXTURE_ENV_COLOR:
3056 #endif // defined(GL_TEXTURE_ENV_COLOR)
3057 _needed = 4;
3058 break;
3059 default:
3060 _needed = 1;
3061 break;
3062 }
3063 if (_remaining < _needed) {
3064 _exception = 1;
3065 _exceptionType = "java/lang/IllegalArgumentException";
3066 _exceptionMessage = "remaining() < needed";
3067 goto exit;
3068 }
3069 if (params == NULL) {
3070 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
3071 params = (GLfloat *) (_paramsBase + _bufferOffset);
3072 }
3073 glTexEnvfv(
3074 (GLenum)target,
3075 (GLenum)pname,
3076 (GLfloat *)params
3077 );
3078
3079 exit:
3080 if (_array) {
3081 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
3082 }
3083 if (_exception) {
3084 jniThrowException(_env, _exceptionType, _exceptionMessage);
3085 }
3086 }
3087
3088 /* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
3089 static void
android_glTexEnvx__III(JNIEnv * _env,jobject _this,jint target,jint pname,jint param)3090 android_glTexEnvx__III
3091 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3092 glTexEnvx(
3093 (GLenum)target,
3094 (GLenum)pname,
3095 (GLfixed)param
3096 );
3097 }
3098
3099 /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3100 static void
android_glTexEnvxv__II_3II(JNIEnv * _env,jobject _this,jint target,jint pname,jintArray params_ref,jint offset)3101 android_glTexEnvxv__II_3II
3102 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
3103 jint _exception = 0;
3104 const char * _exceptionType = NULL;
3105 const char * _exceptionMessage = NULL;
3106 GLfixed *params_base = (GLfixed *) 0;
3107 jint _remaining;
3108 GLfixed *params = (GLfixed *) 0;
3109
3110 if (!params_ref) {
3111 _exception = 1;
3112 _exceptionType = "java/lang/IllegalArgumentException";
3113 _exceptionMessage = "params == null";
3114 goto exit;
3115 }
3116 if (offset < 0) {
3117 _exception = 1;
3118 _exceptionType = "java/lang/IllegalArgumentException";
3119 _exceptionMessage = "offset < 0";
3120 goto exit;
3121 }
3122 _remaining = _env->GetArrayLength(params_ref) - offset;
3123 int _needed;
3124 switch (pname) {
3125 #if defined(GL_TEXTURE_ENV_COLOR)
3126 case GL_TEXTURE_ENV_COLOR:
3127 #endif // defined(GL_TEXTURE_ENV_COLOR)
3128 _needed = 4;
3129 break;
3130 default:
3131 _needed = 1;
3132 break;
3133 }
3134 if (_remaining < _needed) {
3135 _exception = 1;
3136 _exceptionType = "java/lang/IllegalArgumentException";
3137 _exceptionMessage = "length - offset < needed";
3138 goto exit;
3139 }
3140 params_base = (GLfixed *)
3141 _env->GetIntArrayElements(params_ref, (jboolean *)0);
3142 params = params_base + offset;
3143
3144 glTexEnvxv(
3145 (GLenum)target,
3146 (GLenum)pname,
3147 (GLfixed *)params
3148 );
3149
3150 exit:
3151 if (params_base) {
3152 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
3153 JNI_ABORT);
3154 }
3155 if (_exception) {
3156 jniThrowException(_env, _exceptionType, _exceptionMessage);
3157 }
3158 }
3159
3160 /* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3161 static void
android_glTexEnvxv__IILjava_nio_IntBuffer_2(JNIEnv * _env,jobject _this,jint target,jint pname,jobject params_buf)3162 android_glTexEnvxv__IILjava_nio_IntBuffer_2
3163 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
3164 jint _exception = 0;
3165 const char * _exceptionType = NULL;
3166 const char * _exceptionMessage = NULL;
3167 jintArray _array = (jintArray) 0;
3168 jint _bufferOffset = (jint) 0;
3169 jint _remaining;
3170 GLfixed *params = (GLfixed *) 0;
3171
3172 if (!params_buf) {
3173 _exception = 1;
3174 _exceptionType = "java/lang/IllegalArgumentException";
3175 _exceptionMessage = "params == null";
3176 goto exit;
3177 }
3178 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3179 int _needed;
3180 switch (pname) {
3181 #if defined(GL_TEXTURE_ENV_COLOR)
3182 case GL_TEXTURE_ENV_COLOR:
3183 #endif // defined(GL_TEXTURE_ENV_COLOR)
3184 _needed = 4;
3185 break;
3186 default:
3187 _needed = 1;
3188 break;
3189 }
3190 if (_remaining < _needed) {
3191 _exception = 1;
3192 _exceptionType = "java/lang/IllegalArgumentException";
3193 _exceptionMessage = "remaining() < needed";
3194 goto exit;
3195 }
3196 if (params == NULL) {
3197 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
3198 params = (GLfixed *) (_paramsBase + _bufferOffset);
3199 }
3200 glTexEnvxv(
3201 (GLenum)target,
3202 (GLenum)pname,
3203 (GLfixed *)params
3204 );
3205
3206 exit:
3207 if (_array) {
3208 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
3209 }
3210 if (_exception) {
3211 jniThrowException(_env, _exceptionType, _exceptionMessage);
3212 }
3213 }
3214
3215 /* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
3216 static void
android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2(JNIEnv * _env,jobject _this,jint target,jint level,jint internalformat,jint width,jint height,jint border,jint format,jint type,jobject pixels_buf)3217 android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
3218 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
3219 jint _exception = 0;
3220 const char * _exceptionType = NULL;
3221 const char * _exceptionMessage = NULL;
3222 jarray _array = (jarray) 0;
3223 jint _bufferOffset = (jint) 0;
3224 jint _remaining;
3225 GLvoid *pixels = (GLvoid *) 0;
3226
3227 if (pixels_buf) {
3228 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3229 }
3230 if (pixels_buf && pixels == NULL) {
3231 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3232 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3233 }
3234 glTexImage2D(
3235 (GLenum)target,
3236 (GLint)level,
3237 (GLint)internalformat,
3238 (GLsizei)width,
3239 (GLsizei)height,
3240 (GLint)border,
3241 (GLenum)format,
3242 (GLenum)type,
3243 (GLvoid *)pixels
3244 );
3245 if (_array) {
3246 releasePointer(_env, _array, (void *)((char *)pixels - _bufferOffset), JNI_FALSE);
3247 }
3248 if (_exception) {
3249 jniThrowException(_env, _exceptionType, _exceptionMessage);
3250 }
3251 }
3252
3253 /* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
3254 static void
android_glTexParameterf__IIF(JNIEnv * _env,jobject _this,jint target,jint pname,jfloat param)3255 android_glTexParameterf__IIF
3256 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3257 glTexParameterf(
3258 (GLenum)target,
3259 (GLenum)pname,
3260 (GLfloat)param
3261 );
3262 }
3263
3264 /* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
3265 static void
android_glTexParameterx__III(JNIEnv * _env,jobject _this,jint target,jint pname,jint param)3266 android_glTexParameterx__III
3267 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3268 glTexParameterx(
3269 (GLenum)target,
3270 (GLenum)pname,
3271 (GLfixed)param
3272 );
3273 }
3274
3275 /* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
3276 static void
android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2(JNIEnv * _env,jobject _this,jint target,jint level,jint xoffset,jint yoffset,jint width,jint height,jint format,jint type,jobject pixels_buf)3277 android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
3278 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
3279 jint _exception = 0;
3280 const char * _exceptionType = NULL;
3281 const char * _exceptionMessage = NULL;
3282 jarray _array = (jarray) 0;
3283 jint _bufferOffset = (jint) 0;
3284 jint _remaining;
3285 GLvoid *pixels = (GLvoid *) 0;
3286
3287 if (pixels_buf) {
3288 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3289 }
3290 if (pixels_buf && pixels == NULL) {
3291 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3292 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
3293 }
3294 glTexSubImage2D(
3295 (GLenum)target,
3296 (GLint)level,
3297 (GLint)xoffset,
3298 (GLint)yoffset,
3299 (GLsizei)width,
3300 (GLsizei)height,
3301 (GLenum)format,
3302 (GLenum)type,
3303 (GLvoid *)pixels
3304 );
3305 if (_array) {
3306 releasePointer(_env, _array, (void *)((char *)pixels - _bufferOffset), JNI_FALSE);
3307 }
3308 if (_exception) {
3309 jniThrowException(_env, _exceptionType, _exceptionMessage);
3310 }
3311 }
3312
3313 /* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
3314 static void
android_glTranslatef__FFF(JNIEnv * _env,jobject _this,jfloat x,jfloat y,jfloat z)3315 android_glTranslatef__FFF
3316 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3317 glTranslatef(
3318 (GLfloat)x,
3319 (GLfloat)y,
3320 (GLfloat)z
3321 );
3322 }
3323
3324 /* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
3325 static void
android_glTranslatex__III(JNIEnv * _env,jobject _this,jint x,jint y,jint z)3326 android_glTranslatex__III
3327 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3328 glTranslatex(
3329 (GLfixed)x,
3330 (GLfixed)y,
3331 (GLfixed)z
3332 );
3333 }
3334
3335 /* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3336 static void
android_glVertexPointerBounds__IIILjava_nio_Buffer_2I(JNIEnv * _env,jobject _this,jint size,jint type,jint stride,jobject pointer_buf,jint remaining)3337 android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
3338 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3339 jint _exception = 0;
3340 const char * _exceptionType = NULL;
3341 const char * _exceptionMessage = NULL;
3342 jarray _array = (jarray) 0;
3343 jint _bufferOffset = (jint) 0;
3344 jint _remaining;
3345 GLvoid *pointer = (GLvoid *) 0;
3346
3347 if (pointer_buf) {
3348 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
3349 if ( ! pointer ) {
3350 return;
3351 }
3352 }
3353 glVertexPointerBounds(
3354 (GLint)size,
3355 (GLenum)type,
3356 (GLsizei)stride,
3357 (GLvoid *)pointer,
3358 (GLsizei)remaining
3359 );
3360 if (_exception) {
3361 jniThrowException(_env, _exceptionType, _exceptionMessage);
3362 }
3363 }
3364
3365 /* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3366 static void
android_glViewport__IIII(JNIEnv * _env,jobject _this,jint x,jint y,jint width,jint height)3367 android_glViewport__IIII
3368 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3369 glViewport(
3370 (GLint)x,
3371 (GLint)y,
3372 (GLsizei)width,
3373 (GLsizei)height
3374 );
3375 }
3376
3377 static const char *classPathName = "android/opengl/GLES10";
3378
3379 static const JNINativeMethod methods[] = {
3380 {"_nativeClassInit", "()V", (void*)nativeClassInit },
3381 {"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
3382 {"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
3383 {"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
3384 {"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
3385 {"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
3386 {"glClear", "(I)V", (void *) android_glClear__I },
3387 {"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
3388 {"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
3389 {"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
3390 {"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
3391 {"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
3392 {"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
3393 {"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
3394 {"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
3395 {"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
3396 {"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
3397 {"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
3398 {"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3399 {"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
3400 {"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
3401 {"glCullFace", "(I)V", (void *) android_glCullFace__I },
3402 {"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
3403 {"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
3404 {"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
3405 {"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
3406 {"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
3407 {"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
3408 {"glDisable", "(I)V", (void *) android_glDisable__I },
3409 {"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
3410 {"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
3411 {"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
3412 {"glEnable", "(I)V", (void *) android_glEnable__I },
3413 {"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
3414 {"glFinish", "()V", (void *) android_glFinish__ },
3415 {"glFlush", "()V", (void *) android_glFlush__ },
3416 {"glFogf", "(IF)V", (void *) android_glFogf__IF },
3417 {"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
3418 {"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
3419 {"glFogx", "(II)V", (void *) android_glFogx__II },
3420 {"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
3421 {"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
3422 {"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
3423 {"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
3424 {"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
3425 {"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
3426 {"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
3427 {"glGetError", "()I", (void *) android_glGetError__ },
3428 {"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
3429 {"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
3430 {"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
3431 {"glHint", "(II)V", (void *) android_glHint__II },
3432 {"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
3433 {"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
3434 {"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
3435 {"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
3436 {"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
3437 {"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
3438 {"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
3439 {"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
3440 {"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
3441 {"glLightx", "(III)V", (void *) android_glLightx__III },
3442 {"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
3443 {"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
3444 {"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
3445 {"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
3446 {"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
3447 {"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
3448 {"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
3449 {"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
3450 {"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
3451 {"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
3452 {"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
3453 {"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
3454 {"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
3455 {"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
3456 {"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
3457 {"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
3458 {"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
3459 {"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
3460 {"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
3461 {"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
3462 {"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
3463 {"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
3464 {"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
3465 {"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
3466 {"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
3467 {"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
3468 {"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
3469 {"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
3470 {"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
3471 {"glPointSize", "(F)V", (void *) android_glPointSize__F },
3472 {"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
3473 {"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
3474 {"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
3475 {"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
3476 {"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
3477 {"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
3478 {"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
3479 {"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
3480 {"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
3481 {"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
3482 {"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
3483 {"glScalex", "(III)V", (void *) android_glScalex__III },
3484 {"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
3485 {"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
3486 {"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
3487 {"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
3488 {"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
3489 {"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
3490 {"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
3491 {"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
3492 {"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
3493 {"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
3494 {"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
3495 {"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
3496 {"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
3497 {"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
3498 {"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
3499 {"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3500 {"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
3501 {"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
3502 {"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
3503 {"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
3504 };
3505
register_android_opengl_jni_GLES10(JNIEnv * _env)3506 int register_android_opengl_jni_GLES10(JNIEnv *_env)
3507 {
3508 int err;
3509 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
3510 return err;
3511 }
3512