blob: b93ae80b2920c46177df89f5da53a8a404cf3767 [file] [log] [blame]
Jack Palevich27f80022009-04-15 19:13:17 -07001/*
2**
3** Copyright 2009, The Android Open Source Project
4**
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07005** Licensed under the Apache License, Version 2.0 (the "License");
6** you may not use this file except in compliance with the License.
7** You may obtain a copy of the License at
Jack Palevich27f80022009-04-15 19:13:17 -07008**
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07009** http://www.apache.org/licenses/LICENSE-2.0
Jack Palevich27f80022009-04-15 19:13:17 -070010**
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070011** Unless required by applicable law or agreed to in writing, software
12** distributed under the License is distributed on an "AS IS" BASIS,
13** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14** See the License for the specific language governing permissions and
Jack Palevich27f80022009-04-15 19:13:17 -070015** limitations under the License.
16*/
17
18// This source file is automatically generated
19
Andreas Gampebfe63332014-11-12 14:12:45 -080020#pragma GCC diagnostic ignored "-Wunused-variable"
21#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
22#pragma GCC diagnostic ignored "-Wunused-function"
23
Mathias Agopian2ad04772013-02-23 03:12:30 -080024#include <GLES/gl.h>
25#include <GLES/glext.h>
26
Jesse Hall9626f822014-05-19 20:57:49 -070027#include <jni.h>
Steven Moreland2279b252017-07-19 09:50:45 -070028#include <nativehelper/JNIHelp.h>
Jack Palevich27f80022009-04-15 19:13:17 -070029#include <android_runtime/AndroidRuntime.h>
30#include <utils/misc.h>
Jack Palevich27f80022009-04-15 19:13:17 -070031#include <assert.h>
Mathias Agopian8331f722009-05-08 15:35:17 -070032
Jack Palevich27f80022009-04-15 19:13:17 -070033static int initialized = 0;
34
35static jclass nioAccessClass;
36static jclass bufferClass;
Jack Palevich27f80022009-04-15 19:13:17 -070037static jmethodID getBasePointerID;
38static jmethodID getBaseArrayID;
39static jmethodID getBaseArrayOffsetID;
40static jfieldID positionID;
41static jfieldID limitID;
42static jfieldID elementSizeShiftID;
43
Mathias Agopian2ad04772013-02-23 03:12:30 -080044
45/* special calls implemented in Android's GLES wrapper used to more
46 * efficiently bound-check passed arrays */
47extern "C" {
48#ifdef GL_VERSION_ES_CM_1_1
49GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
50 const GLvoid *ptr, GLsizei count);
51GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
52 const GLvoid *pointer, GLsizei count);
53GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
54 GLsizei stride, const GLvoid *pointer, GLsizei count);
55GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
56 GLsizei stride, const GLvoid *pointer, GLsizei count);
57GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
58 GLsizei stride, const GLvoid *pointer, GLsizei count);
59GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count);
61GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
62 GLsizei stride, const GLvoid *pointer, GLsizei count);
63#endif
64#ifdef GL_ES_VERSION_2_0
65static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
66 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
67 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
68}
69#endif
Andy McFaddencee51982013-04-25 16:08:31 -070070#ifdef GL_ES_VERSION_3_0
71static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
72 GLsizei stride, const GLvoid *pointer, GLsizei count) {
73 glVertexAttribIPointer(indx, size, type, stride, pointer);
74}
75#endif
Mathias Agopian2ad04772013-02-23 03:12:30 -080076}
77
Jack Palevich27f80022009-04-15 19:13:17 -070078/* Cache method IDs each time the class is loaded. */
79
80static void
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070081nativeClassInit(JNIEnv *_env, jclass glImplClass)
Jack Palevich27f80022009-04-15 19:13:17 -070082{
83 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
84 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
85
86 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
87 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
88
89 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
90 "getBasePointer", "(Ljava/nio/Buffer;)J");
91 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
92 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
93 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
94 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
95
96 positionID = _env->GetFieldID(bufferClass, "position", "I");
97 limitID = _env->GetFieldID(bufferClass, "limit", "I");
98 elementSizeShiftID =
99 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
100}
101
Jack Palevich27f80022009-04-15 19:13:17 -0700102static void *
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700103getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
Jack Palevich27f80022009-04-15 19:13:17 -0700104{
105 jint position;
106 jint limit;
107 jint elementSizeShift;
108 jlong pointer;
Jack Palevich27f80022009-04-15 19:13:17 -0700109
110 position = _env->GetIntField(buffer, positionID);
111 limit = _env->GetIntField(buffer, limitID);
112 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
113 *remaining = (limit - position) << elementSizeShift;
114 pointer = _env->CallStaticLongMethod(nioAccessClass,
115 getBasePointerID, buffer);
116 if (pointer != 0L) {
117 *array = NULL;
Ashok Bhat01c26ea2014-02-24 09:49:07 +0000118 return reinterpret_cast<void*>(pointer);
Jack Palevich27f80022009-04-15 19:13:17 -0700119 }
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700120
Jack Palevich27f80022009-04-15 19:13:17 -0700121 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
122 getBaseArrayID, buffer);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700123 *offset = _env->CallStaticIntMethod(nioAccessClass,
Jack Palevich27f80022009-04-15 19:13:17 -0700124 getBaseArrayOffsetID, buffer);
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700125
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700126 return NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700127}
128
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700129class ByteArrayGetter {
130public:
131 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
132 return _env->GetByteArrayElements(array, is_copy);
133 }
134};
135class BooleanArrayGetter {
136public:
137 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
138 return _env->GetBooleanArrayElements(array, is_copy);
139 }
140};
141class CharArrayGetter {
142public:
143 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
144 return _env->GetCharArrayElements(array, is_copy);
145 }
146};
147class ShortArrayGetter {
148public:
149 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
150 return _env->GetShortArrayElements(array, is_copy);
151 }
152};
153class IntArrayGetter {
154public:
155 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
156 return _env->GetIntArrayElements(array, is_copy);
157 }
158};
159class LongArrayGetter {
160public:
161 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
162 return _env->GetLongArrayElements(array, is_copy);
163 }
164};
165class FloatArrayGetter {
166public:
167 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
168 return _env->GetFloatArrayElements(array, is_copy);
169 }
170};
171class DoubleArrayGetter {
172public:
173 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
174 return _env->GetDoubleArrayElements(array, is_copy);
175 }
176};
177
178template<typename JTYPEARRAY, typename ARRAYGETTER>
179static void*
180getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
181 return ARRAYGETTER::Get(_env, array, is_copy);
182}
183
184class ByteArrayReleaser {
185public:
186 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
187 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
188 }
189};
190class BooleanArrayReleaser {
191public:
192 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
193 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
194 }
195};
196class CharArrayReleaser {
197public:
198 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
199 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
200 }
201};
202class ShortArrayReleaser {
203public:
204 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
205 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
206 }
207};
208class IntArrayReleaser {
209public:
210 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
211 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
212 }
213};
214class LongArrayReleaser {
215public:
216 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
217 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
218 }
219};
220class FloatArrayReleaser {
221public:
222 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
223 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
224 }
225};
226class DoubleArrayReleaser {
227public:
228 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
229 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
230 }
231};
232
233template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
234static void
235releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
236 ARRAYRELEASER::Release(_env, array, data, commit);
237}
238
Jack Palevich27f80022009-04-15 19:13:17 -0700239static void
240releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
241{
242 _env->ReleasePrimitiveArrayCritical(array, data,
Mathias Agopian2ad04772013-02-23 03:12:30 -0800243 commit ? 0 : JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -0700244}
245
Jack Palevich16e79722009-05-15 18:13:34 -0700246static void *
247getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
248 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
249 if (buf) {
250 jint position = _env->GetIntField(buffer, positionID);
251 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
252 buf += position << elementSizeShift;
253 } else {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700254 jniThrowException(_env, "java/lang/IllegalArgumentException",
255 "Must use a native order direct Buffer");
Jack Palevich16e79722009-05-15 18:13:34 -0700256 }
257 return (void*) buf;
258}
259
Mathias Agopian2ad04772013-02-23 03:12:30 -0800260// --------------------------------------------------------------------------
261
262/*
263 * returns the number of values glGet returns for a given pname.
264 *
265 * The code below is written such that pnames requiring only one values
266 * are the default (and are not explicitely tested for). This makes the
267 * checking code much shorter/readable/efficient.
268 *
269 * This means that unknown pnames (e.g.: extensions) will default to 1. If
270 * that unknown pname needs more than 1 value, then the validation check
271 * is incomplete and the app may crash if it passed the wrong number params.
272 */
273static int getNeededCount(GLint pname) {
274 int needed = 1;
275#ifdef GL_ES_VERSION_2_0
276 // GLES 2.x pnames
277 switch (pname) {
278 case GL_ALIASED_LINE_WIDTH_RANGE:
279 case GL_ALIASED_POINT_SIZE_RANGE:
280 needed = 2;
281 break;
282
283 case GL_BLEND_COLOR:
284 case GL_COLOR_CLEAR_VALUE:
285 case GL_COLOR_WRITEMASK:
286 case GL_SCISSOR_BOX:
287 case GL_VIEWPORT:
288 needed = 4;
289 break;
290
291 case GL_COMPRESSED_TEXTURE_FORMATS:
292 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
293 break;
294
295 case GL_SHADER_BINARY_FORMATS:
296 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
297 break;
298 }
299#endif
300
301#ifdef GL_VERSION_ES_CM_1_1
302 // GLES 1.x pnames
303 switch (pname) {
304 case GL_ALIASED_LINE_WIDTH_RANGE:
305 case GL_ALIASED_POINT_SIZE_RANGE:
306 case GL_DEPTH_RANGE:
307 case GL_SMOOTH_LINE_WIDTH_RANGE:
308 case GL_SMOOTH_POINT_SIZE_RANGE:
309 needed = 2;
310 break;
311
312 case GL_CURRENT_NORMAL:
313 case GL_POINT_DISTANCE_ATTENUATION:
314 needed = 3;
315 break;
316
317 case GL_COLOR_CLEAR_VALUE:
318 case GL_COLOR_WRITEMASK:
319 case GL_CURRENT_COLOR:
320 case GL_CURRENT_TEXTURE_COORDS:
321 case GL_FOG_COLOR:
322 case GL_LIGHT_MODEL_AMBIENT:
323 case GL_SCISSOR_BOX:
324 case GL_VIEWPORT:
325 needed = 4;
326 break;
327
328 case GL_MODELVIEW_MATRIX:
329 case GL_PROJECTION_MATRIX:
330 case GL_TEXTURE_MATRIX:
331 needed = 16;
332 break;
333
334 case GL_COMPRESSED_TEXTURE_FORMATS:
335 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
336 break;
337 }
338#endif
339 return needed;
340}
341
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700342template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
343 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
Mathias Agopian2ad04772013-02-23 03:12:30 -0800344static void
345get
346 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
347 jint _exception = 0;
348 const char * _exceptionType;
349 const char * _exceptionMessage;
350 CTYPE *params_base = (CTYPE *) 0;
351 jint _remaining;
352 CTYPE *params = (CTYPE *) 0;
353 int _needed = 0;
354
355 if (!params_ref) {
356 _exception = 1;
357 _exceptionType = "java/lang/IllegalArgumentException";
358 _exceptionMessage = "params == null";
359 goto exit;
360 }
361 if (offset < 0) {
362 _exception = 1;
363 _exceptionType = "java/lang/IllegalArgumentException";
364 _exceptionMessage = "offset < 0";
365 goto exit;
366 }
367 _remaining = _env->GetArrayLength(params_ref) - offset;
368 _needed = getNeededCount(pname);
369 // if we didn't find this pname, we just assume the user passed
370 // an array of the right size -- this might happen with extensions
371 // or if we forget an enum here.
372 if (_remaining < _needed) {
373 _exception = 1;
374 _exceptionType = "java/lang/IllegalArgumentException";
375 _exceptionMessage = "length - offset < needed";
376 goto exit;
377 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700378 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
379 _env, params_ref, (jboolean *)0);
Mathias Agopian2ad04772013-02-23 03:12:30 -0800380 params = params_base + offset;
381
382 GET(
383 (GLenum)pname,
384 (CTYPE *)params
385 );
386
387exit:
388 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700389 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
390 _env, params_ref, params_base, !_exception);
Mathias Agopian2ad04772013-02-23 03:12:30 -0800391 }
392 if (_exception) {
393 jniThrowException(_env, _exceptionType, _exceptionMessage);
394 }
395}
396
397
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700398template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
399 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
Mathias Agopian2ad04772013-02-23 03:12:30 -0800400static void
401getarray
402 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
403 jint _exception = 0;
404 const char * _exceptionType;
405 const char * _exceptionMessage;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700406 JTYPEARRAY _array = (JTYPEARRAY) 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800407 jint _bufferOffset = (jint) 0;
408 jint _remaining;
409 CTYPE *params = (CTYPE *) 0;
410 int _needed = 0;
411
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700412 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Andy McFaddencee51982013-04-25 16:08:31 -0700413 _remaining /= sizeof(CTYPE); // convert from bytes to item count
Mathias Agopian2ad04772013-02-23 03:12:30 -0800414 _needed = getNeededCount(pname);
415 // if we didn't find this pname, we just assume the user passed
416 // an array of the right size -- this might happen with extensions
417 // or if we forget an enum here.
418 if (_needed>0 && _remaining < _needed) {
419 _exception = 1;
420 _exceptionType = "java/lang/IllegalArgumentException";
421 _exceptionMessage = "remaining() < needed";
422 goto exit;
423 }
424 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700425 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
426 _env, _array, (jboolean *) 0);
Mathias Agopian2ad04772013-02-23 03:12:30 -0800427 params = (CTYPE *) (_paramsBase + _bufferOffset);
428 }
429 GET(
430 (GLenum)pname,
431 (CTYPE *)params
432 );
433
434exit:
435 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700436 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
437 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
Mathias Agopian2ad04772013-02-23 03:12:30 -0800438 }
439 if (_exception) {
440 jniThrowException(_env, _exceptionType, _exceptionMessage);
441 }
Jack Palevichbe509c92009-05-07 09:52:14 -0700442}
443
Jack Palevich27f80022009-04-15 19:13:17 -0700444// --------------------------------------------------------------------------
Jack Palevich27f80022009-04-15 19:13:17 -0700445/* void glActiveTexture ( GLenum texture ) */
446static void
447android_glActiveTexture__I
448 (JNIEnv *_env, jobject _this, jint texture) {
449 glActiveTexture(
450 (GLenum)texture
451 );
452}
453
454/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
455static void
456android_glAlphaFunc__IF
457 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
458 glAlphaFunc(
459 (GLenum)func,
460 (GLclampf)ref
461 );
462}
463
464/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
465static void
466android_glAlphaFuncx__II
467 (JNIEnv *_env, jobject _this, jint func, jint ref) {
468 glAlphaFuncx(
469 (GLenum)func,
470 (GLclampx)ref
471 );
472}
473
474/* void glBindTexture ( GLenum target, GLuint texture ) */
475static void
476android_glBindTexture__II
477 (JNIEnv *_env, jobject _this, jint target, jint texture) {
478 glBindTexture(
479 (GLenum)target,
480 (GLuint)texture
481 );
482}
483
484/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
485static void
486android_glBlendFunc__II
487 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
488 glBlendFunc(
489 (GLenum)sfactor,
490 (GLenum)dfactor
491 );
492}
493
494/* void glClear ( GLbitfield mask ) */
495static void
496android_glClear__I
497 (JNIEnv *_env, jobject _this, jint mask) {
498 glClear(
499 (GLbitfield)mask
500 );
501}
502
503/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
504static void
505android_glClearColor__FFFF
506 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
507 glClearColor(
508 (GLclampf)red,
509 (GLclampf)green,
510 (GLclampf)blue,
511 (GLclampf)alpha
512 );
513}
514
515/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
516static void
517android_glClearColorx__IIII
518 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
519 glClearColorx(
520 (GLclampx)red,
521 (GLclampx)green,
522 (GLclampx)blue,
523 (GLclampx)alpha
524 );
525}
526
527/* void glClearDepthf ( GLclampf depth ) */
528static void
529android_glClearDepthf__F
530 (JNIEnv *_env, jobject _this, jfloat depth) {
531 glClearDepthf(
532 (GLclampf)depth
533 );
534}
535
536/* void glClearDepthx ( GLclampx depth ) */
537static void
538android_glClearDepthx__I
539 (JNIEnv *_env, jobject _this, jint depth) {
540 glClearDepthx(
541 (GLclampx)depth
542 );
543}
544
545/* void glClearStencil ( GLint s ) */
546static void
547android_glClearStencil__I
548 (JNIEnv *_env, jobject _this, jint s) {
549 glClearStencil(
550 (GLint)s
551 );
552}
553
554/* void glClientActiveTexture ( GLenum texture ) */
555static void
556android_glClientActiveTexture__I
557 (JNIEnv *_env, jobject _this, jint texture) {
558 glClientActiveTexture(
559 (GLenum)texture
560 );
561}
562
563/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
564static void
565android_glColor4f__FFFF
566 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
567 glColor4f(
568 (GLfloat)red,
569 (GLfloat)green,
570 (GLfloat)blue,
571 (GLfloat)alpha
572 );
573}
574
575/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
576static void
577android_glColor4x__IIII
578 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
579 glColor4x(
580 (GLfixed)red,
581 (GLfixed)green,
582 (GLfixed)blue,
583 (GLfixed)alpha
584 );
585}
586
587/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
588static void
589android_glColorMask__ZZZZ
590 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
591 glColorMask(
592 (GLboolean)red,
593 (GLboolean)green,
594 (GLboolean)blue,
595 (GLboolean)alpha
596 );
597}
598
599/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
600static void
601android_glColorPointerBounds__IIILjava_nio_Buffer_2I
602 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
603 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700604 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700605 jint _remaining;
606 GLvoid *pointer = (GLvoid *) 0;
607
Jack Paleviche20ea782009-05-07 18:28:29 -0700608 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -0700609 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -0700610 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -0700611 return;
612 }
613 }
Jack Palevich27f80022009-04-15 19:13:17 -0700614 glColorPointerBounds(
615 (GLint)size,
616 (GLenum)type,
617 (GLsizei)stride,
618 (GLvoid *)pointer,
619 (GLsizei)remaining
620 );
Jack Palevich27f80022009-04-15 19:13:17 -0700621}
622
623/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
624static void
625android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
626 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
627 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700628 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700629 jint _remaining;
630 GLvoid *data = (GLvoid *) 0;
631
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700632 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700633 if (data == NULL) {
634 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
635 data = (GLvoid *) (_dataBase + _bufferOffset);
636 }
Jack Palevich27f80022009-04-15 19:13:17 -0700637 glCompressedTexImage2D(
638 (GLenum)target,
639 (GLint)level,
640 (GLenum)internalformat,
641 (GLsizei)width,
642 (GLsizei)height,
643 (GLint)border,
644 (GLsizei)imageSize,
645 (GLvoid *)data
646 );
647 if (_array) {
648 releasePointer(_env, _array, data, JNI_FALSE);
649 }
650}
651
652/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
653static void
654android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
655 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
656 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700657 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700658 jint _remaining;
659 GLvoid *data = (GLvoid *) 0;
660
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700661 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700662 if (data == NULL) {
663 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
664 data = (GLvoid *) (_dataBase + _bufferOffset);
665 }
Jack Palevich27f80022009-04-15 19:13:17 -0700666 glCompressedTexSubImage2D(
667 (GLenum)target,
668 (GLint)level,
669 (GLint)xoffset,
670 (GLint)yoffset,
671 (GLsizei)width,
672 (GLsizei)height,
673 (GLenum)format,
674 (GLsizei)imageSize,
675 (GLvoid *)data
676 );
677 if (_array) {
678 releasePointer(_env, _array, data, JNI_FALSE);
679 }
680}
681
682/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
683static void
684android_glCopyTexImage2D__IIIIIIII
685 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
686 glCopyTexImage2D(
687 (GLenum)target,
688 (GLint)level,
689 (GLenum)internalformat,
690 (GLint)x,
691 (GLint)y,
692 (GLsizei)width,
693 (GLsizei)height,
694 (GLint)border
695 );
696}
697
698/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
699static void
700android_glCopyTexSubImage2D__IIIIIIII
701 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
702 glCopyTexSubImage2D(
703 (GLenum)target,
704 (GLint)level,
705 (GLint)xoffset,
706 (GLint)yoffset,
707 (GLint)x,
708 (GLint)y,
709 (GLsizei)width,
710 (GLsizei)height
711 );
712}
713
714/* void glCullFace ( GLenum mode ) */
715static void
716android_glCullFace__I
717 (JNIEnv *_env, jobject _this, jint mode) {
718 glCullFace(
719 (GLenum)mode
720 );
721}
722
723/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
724static void
725android_glDeleteTextures__I_3II
726 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700727 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800728 const char * _exceptionType = NULL;
729 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700730 GLuint *textures_base = (GLuint *) 0;
731 jint _remaining;
732 GLuint *textures = (GLuint *) 0;
733
734 if (!textures_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700735 _exception = 1;
736 _exceptionType = "java/lang/IllegalArgumentException";
737 _exceptionMessage = "textures == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700738 goto exit;
739 }
740 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700741 _exception = 1;
742 _exceptionType = "java/lang/IllegalArgumentException";
743 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -0700744 goto exit;
745 }
746 _remaining = _env->GetArrayLength(textures_ref) - offset;
747 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700748 _exception = 1;
749 _exceptionType = "java/lang/IllegalArgumentException";
750 _exceptionMessage = "length - offset < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700751 goto exit;
752 }
753 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700754 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -0700755 textures = textures_base + offset;
756
757 glDeleteTextures(
758 (GLsizei)n,
759 (GLuint *)textures
760 );
761
762exit:
763 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700764 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
Jack Palevich27f80022009-04-15 19:13:17 -0700765 JNI_ABORT);
766 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700767 if (_exception) {
768 jniThrowException(_env, _exceptionType, _exceptionMessage);
769 }
Jack Palevich27f80022009-04-15 19:13:17 -0700770}
771
772/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
773static void
774android_glDeleteTextures__ILjava_nio_IntBuffer_2
775 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700776 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800777 const char * _exceptionType = NULL;
778 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700779 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700780 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700781 jint _remaining;
782 GLuint *textures = (GLuint *) 0;
783
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700784 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700785 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700786 _exception = 1;
787 _exceptionType = "java/lang/IllegalArgumentException";
788 _exceptionMessage = "remaining() < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700789 goto exit;
790 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700791 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700792 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700793 textures = (GLuint *) (_texturesBase + _bufferOffset);
794 }
Jack Palevich27f80022009-04-15 19:13:17 -0700795 glDeleteTextures(
796 (GLsizei)n,
797 (GLuint *)textures
798 );
799
800exit:
801 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700802 _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -0700803 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700804 if (_exception) {
805 jniThrowException(_env, _exceptionType, _exceptionMessage);
806 }
Jack Palevich27f80022009-04-15 19:13:17 -0700807}
808
809/* void glDepthFunc ( GLenum func ) */
810static void
811android_glDepthFunc__I
812 (JNIEnv *_env, jobject _this, jint func) {
813 glDepthFunc(
814 (GLenum)func
815 );
816}
817
818/* void glDepthMask ( GLboolean flag ) */
819static void
820android_glDepthMask__Z
821 (JNIEnv *_env, jobject _this, jboolean flag) {
822 glDepthMask(
823 (GLboolean)flag
824 );
825}
826
827/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
828static void
829android_glDepthRangef__FF
830 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
831 glDepthRangef(
832 (GLclampf)zNear,
833 (GLclampf)zFar
834 );
835}
836
837/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
838static void
839android_glDepthRangex__II
840 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
841 glDepthRangex(
842 (GLclampx)zNear,
843 (GLclampx)zFar
844 );
845}
846
847/* void glDisable ( GLenum cap ) */
848static void
849android_glDisable__I
850 (JNIEnv *_env, jobject _this, jint cap) {
851 glDisable(
852 (GLenum)cap
853 );
854}
855
856/* void glDisableClientState ( GLenum array ) */
857static void
858android_glDisableClientState__I
859 (JNIEnv *_env, jobject _this, jint array) {
860 glDisableClientState(
861 (GLenum)array
862 );
863}
864
865/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
866static void
867android_glDrawArrays__III
868 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
869 glDrawArrays(
870 (GLenum)mode,
871 (GLint)first,
872 (GLsizei)count
873 );
874}
875
876/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
877static void
878android_glDrawElements__IIILjava_nio_Buffer_2
879 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700880 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800881 const char * _exceptionType = NULL;
882 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700883 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700884 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700885 jint _remaining;
886 GLvoid *indices = (GLvoid *) 0;
887
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700888 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700889 if (_remaining < count) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700890 _exception = 1;
891 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
892 _exceptionMessage = "remaining() < count < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700893 goto exit;
894 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700895 if (indices == NULL) {
896 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
897 indices = (GLvoid *) (_indicesBase + _bufferOffset);
898 }
Jack Palevich27f80022009-04-15 19:13:17 -0700899 glDrawElements(
900 (GLenum)mode,
901 (GLsizei)count,
902 (GLenum)type,
903 (GLvoid *)indices
904 );
905
906exit:
907 if (_array) {
908 releasePointer(_env, _array, indices, JNI_FALSE);
909 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700910 if (_exception) {
911 jniThrowException(_env, _exceptionType, _exceptionMessage);
912 }
Jack Palevich27f80022009-04-15 19:13:17 -0700913}
914
915/* void glEnable ( GLenum cap ) */
916static void
917android_glEnable__I
918 (JNIEnv *_env, jobject _this, jint cap) {
919 glEnable(
920 (GLenum)cap
921 );
922}
923
924/* void glEnableClientState ( GLenum array ) */
925static void
926android_glEnableClientState__I
927 (JNIEnv *_env, jobject _this, jint array) {
928 glEnableClientState(
929 (GLenum)array
930 );
931}
932
933/* void glFinish ( void ) */
934static void
935android_glFinish__
936 (JNIEnv *_env, jobject _this) {
937 glFinish();
938}
939
940/* void glFlush ( void ) */
941static void
942android_glFlush__
943 (JNIEnv *_env, jobject _this) {
944 glFlush();
945}
946
947/* void glFogf ( GLenum pname, GLfloat param ) */
948static void
949android_glFogf__IF
950 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
951 glFogf(
952 (GLenum)pname,
953 (GLfloat)param
954 );
955}
956
957/* void glFogfv ( GLenum pname, const GLfloat *params ) */
958static void
959android_glFogfv__I_3FI
960 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700961 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800962 const char * _exceptionType = NULL;
963 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700964 GLfloat *params_base = (GLfloat *) 0;
965 jint _remaining;
966 GLfloat *params = (GLfloat *) 0;
967
968 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700969 _exception = 1;
970 _exceptionType = "java/lang/IllegalArgumentException";
971 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700972 goto exit;
973 }
974 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700975 _exception = 1;
976 _exceptionType = "java/lang/IllegalArgumentException";
977 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -0700978 goto exit;
979 }
980 _remaining = _env->GetArrayLength(params_ref) - offset;
981 int _needed;
982 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -0700983#if defined(GL_FOG_COLOR)
984 case GL_FOG_COLOR:
985#endif // defined(GL_FOG_COLOR)
986 _needed = 4;
987 break;
988 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -0800989 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -0700990 break;
991 }
992 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700993 _exception = 1;
994 _exceptionType = "java/lang/IllegalArgumentException";
995 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700996 goto exit;
997 }
998 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700999 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001000 params = params_base + offset;
1001
1002 glFogfv(
1003 (GLenum)pname,
1004 (GLfloat *)params
1005 );
1006
1007exit:
1008 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001009 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001010 JNI_ABORT);
1011 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001012 if (_exception) {
1013 jniThrowException(_env, _exceptionType, _exceptionMessage);
1014 }
Jack Palevich27f80022009-04-15 19:13:17 -07001015}
1016
1017/* void glFogfv ( GLenum pname, const GLfloat *params ) */
1018static void
1019android_glFogfv__ILjava_nio_FloatBuffer_2
1020 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001021 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001022 const char * _exceptionType = NULL;
1023 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001024 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001025 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001026 jint _remaining;
1027 GLfloat *params = (GLfloat *) 0;
1028
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001029 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001030 int _needed;
1031 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001032#if defined(GL_FOG_COLOR)
1033 case GL_FOG_COLOR:
1034#endif // defined(GL_FOG_COLOR)
1035 _needed = 4;
1036 break;
1037 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001038 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001039 break;
1040 }
1041 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001042 _exception = 1;
1043 _exceptionType = "java/lang/IllegalArgumentException";
1044 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001045 goto exit;
1046 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001047 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001048 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001049 params = (GLfloat *) (_paramsBase + _bufferOffset);
1050 }
Jack Palevich27f80022009-04-15 19:13:17 -07001051 glFogfv(
1052 (GLenum)pname,
1053 (GLfloat *)params
1054 );
1055
1056exit:
1057 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001058 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001059 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001060 if (_exception) {
1061 jniThrowException(_env, _exceptionType, _exceptionMessage);
1062 }
Jack Palevich27f80022009-04-15 19:13:17 -07001063}
1064
1065/* void glFogx ( GLenum pname, GLfixed param ) */
1066static void
1067android_glFogx__II
1068 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1069 glFogx(
1070 (GLenum)pname,
1071 (GLfixed)param
1072 );
1073}
1074
1075/* void glFogxv ( GLenum pname, const GLfixed *params ) */
1076static void
1077android_glFogxv__I_3II
1078 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001079 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001080 const char * _exceptionType = NULL;
1081 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001082 GLfixed *params_base = (GLfixed *) 0;
1083 jint _remaining;
1084 GLfixed *params = (GLfixed *) 0;
1085
1086 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001087 _exception = 1;
1088 _exceptionType = "java/lang/IllegalArgumentException";
1089 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001090 goto exit;
1091 }
1092 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001093 _exception = 1;
1094 _exceptionType = "java/lang/IllegalArgumentException";
1095 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001096 goto exit;
1097 }
1098 _remaining = _env->GetArrayLength(params_ref) - offset;
1099 int _needed;
1100 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001101#if defined(GL_FOG_COLOR)
1102 case GL_FOG_COLOR:
1103#endif // defined(GL_FOG_COLOR)
1104 _needed = 4;
1105 break;
1106 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001107 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001108 break;
1109 }
1110 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001111 _exception = 1;
1112 _exceptionType = "java/lang/IllegalArgumentException";
1113 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001114 goto exit;
1115 }
1116 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001117 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001118 params = params_base + offset;
1119
1120 glFogxv(
1121 (GLenum)pname,
1122 (GLfixed *)params
1123 );
1124
1125exit:
1126 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001127 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001128 JNI_ABORT);
1129 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001130 if (_exception) {
1131 jniThrowException(_env, _exceptionType, _exceptionMessage);
1132 }
Jack Palevich27f80022009-04-15 19:13:17 -07001133}
1134
1135/* void glFogxv ( GLenum pname, const GLfixed *params ) */
1136static void
1137android_glFogxv__ILjava_nio_IntBuffer_2
1138 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001139 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001140 const char * _exceptionType = NULL;
1141 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001142 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001143 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001144 jint _remaining;
1145 GLfixed *params = (GLfixed *) 0;
1146
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001147 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001148 int _needed;
1149 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001150#if defined(GL_FOG_COLOR)
1151 case GL_FOG_COLOR:
1152#endif // defined(GL_FOG_COLOR)
1153 _needed = 4;
1154 break;
1155 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001156 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001157 break;
1158 }
1159 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001160 _exception = 1;
1161 _exceptionType = "java/lang/IllegalArgumentException";
1162 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001163 goto exit;
1164 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001165 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001166 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001167 params = (GLfixed *) (_paramsBase + _bufferOffset);
1168 }
Jack Palevich27f80022009-04-15 19:13:17 -07001169 glFogxv(
1170 (GLenum)pname,
1171 (GLfixed *)params
1172 );
1173
1174exit:
1175 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001176 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001177 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001178 if (_exception) {
1179 jniThrowException(_env, _exceptionType, _exceptionMessage);
1180 }
Jack Palevich27f80022009-04-15 19:13:17 -07001181}
1182
1183/* void glFrontFace ( GLenum mode ) */
1184static void
1185android_glFrontFace__I
1186 (JNIEnv *_env, jobject _this, jint mode) {
1187 glFrontFace(
1188 (GLenum)mode
1189 );
1190}
1191
1192/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1193static void
1194android_glFrustumf__FFFFFF
1195 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1196 glFrustumf(
1197 (GLfloat)left,
1198 (GLfloat)right,
1199 (GLfloat)bottom,
1200 (GLfloat)top,
1201 (GLfloat)zNear,
1202 (GLfloat)zFar
1203 );
1204}
1205
1206/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1207static void
1208android_glFrustumx__IIIIII
1209 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1210 glFrustumx(
1211 (GLfixed)left,
1212 (GLfixed)right,
1213 (GLfixed)bottom,
1214 (GLfixed)top,
1215 (GLfixed)zNear,
1216 (GLfixed)zFar
1217 );
1218}
1219
1220/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1221static void
1222android_glGenTextures__I_3II
1223 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1224 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001225 const char * _exceptionType = NULL;
1226 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001227 GLuint *textures_base = (GLuint *) 0;
1228 jint _remaining;
1229 GLuint *textures = (GLuint *) 0;
1230
1231 if (!textures_ref) {
1232 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001233 _exceptionType = "java/lang/IllegalArgumentException";
1234 _exceptionMessage = "textures == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001235 goto exit;
1236 }
1237 if (offset < 0) {
1238 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001239 _exceptionType = "java/lang/IllegalArgumentException";
1240 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001241 goto exit;
1242 }
1243 _remaining = _env->GetArrayLength(textures_ref) - offset;
1244 if (_remaining < n) {
1245 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001246 _exceptionType = "java/lang/IllegalArgumentException";
1247 _exceptionMessage = "length - offset < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001248 goto exit;
1249 }
1250 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001251 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001252 textures = textures_base + offset;
1253
1254 glGenTextures(
1255 (GLsizei)n,
1256 (GLuint *)textures
1257 );
1258
1259exit:
1260 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001261 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001262 _exception ? JNI_ABORT: 0);
1263 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001264 if (_exception) {
1265 jniThrowException(_env, _exceptionType, _exceptionMessage);
1266 }
Jack Palevich27f80022009-04-15 19:13:17 -07001267}
1268
1269/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1270static void
1271android_glGenTextures__ILjava_nio_IntBuffer_2
1272 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1273 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001274 const char * _exceptionType = NULL;
1275 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001276 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001277 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001278 jint _remaining;
1279 GLuint *textures = (GLuint *) 0;
1280
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001281 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001282 if (_remaining < n) {
1283 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001284 _exceptionType = "java/lang/IllegalArgumentException";
1285 _exceptionMessage = "remaining() < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001286 goto exit;
1287 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001288 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001289 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001290 textures = (GLuint *) (_texturesBase + _bufferOffset);
1291 }
Jack Palevich27f80022009-04-15 19:13:17 -07001292 glGenTextures(
1293 (GLsizei)n,
1294 (GLuint *)textures
1295 );
1296
1297exit:
1298 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001299 _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0);
Jack Palevich27f80022009-04-15 19:13:17 -07001300 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001301 if (_exception) {
1302 jniThrowException(_env, _exceptionType, _exceptionMessage);
1303 }
Jack Palevich27f80022009-04-15 19:13:17 -07001304}
1305
1306/* GLenum glGetError ( void ) */
1307static jint
1308android_glGetError__
1309 (JNIEnv *_env, jobject _this) {
1310 GLenum _returnValue;
1311 _returnValue = glGetError();
Andy McFaddencee51982013-04-25 16:08:31 -07001312 return (jint)_returnValue;
Jack Palevich27f80022009-04-15 19:13:17 -07001313}
1314
1315/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1316static void
1317android_glGetIntegerv__I_3II
1318 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001319 get<jintArray, IntArrayGetter, jint*, IntArrayReleaser, GLint, glGetIntegerv>(
1320 _env, _this, pname, params_ref, offset);
Jack Palevich27f80022009-04-15 19:13:17 -07001321}
1322
1323/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1324static void
1325android_glGetIntegerv__ILjava_nio_IntBuffer_2
1326 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001327 getarray<GLint, jintArray, IntArrayGetter, jint*, IntArrayReleaser, glGetIntegerv>(
1328 _env, _this, pname, params_buf);
Jack Palevich27f80022009-04-15 19:13:17 -07001329}
Jack Palevich27f80022009-04-15 19:13:17 -07001330/* const GLubyte * glGetString ( GLenum name ) */
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07001331static jstring android_glGetString(JNIEnv* _env, jobject, jint name) {
1332 const char* chars = (const char*) glGetString((GLenum) name);
1333 return _env->NewStringUTF(chars);
Jack Palevich27f80022009-04-15 19:13:17 -07001334}
1335/* void glHint ( GLenum target, GLenum mode ) */
1336static void
1337android_glHint__II
1338 (JNIEnv *_env, jobject _this, jint target, jint mode) {
1339 glHint(
1340 (GLenum)target,
1341 (GLenum)mode
1342 );
1343}
1344
1345/* void glLightModelf ( GLenum pname, GLfloat param ) */
1346static void
1347android_glLightModelf__IF
1348 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1349 glLightModelf(
1350 (GLenum)pname,
1351 (GLfloat)param
1352 );
1353}
1354
1355/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1356static void
1357android_glLightModelfv__I_3FI
1358 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001359 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001360 const char * _exceptionType = NULL;
1361 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001362 GLfloat *params_base = (GLfloat *) 0;
1363 jint _remaining;
1364 GLfloat *params = (GLfloat *) 0;
1365
1366 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001367 _exception = 1;
1368 _exceptionType = "java/lang/IllegalArgumentException";
1369 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001370 goto exit;
1371 }
1372 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001373 _exception = 1;
1374 _exceptionType = "java/lang/IllegalArgumentException";
1375 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001376 goto exit;
1377 }
1378 _remaining = _env->GetArrayLength(params_ref) - offset;
1379 int _needed;
1380 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001381#if defined(GL_LIGHT_MODEL_AMBIENT)
1382 case GL_LIGHT_MODEL_AMBIENT:
1383#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1384 _needed = 4;
1385 break;
1386 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001387 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001388 break;
1389 }
1390 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001391 _exception = 1;
1392 _exceptionType = "java/lang/IllegalArgumentException";
1393 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001394 goto exit;
1395 }
1396 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001397 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001398 params = params_base + offset;
1399
1400 glLightModelfv(
1401 (GLenum)pname,
1402 (GLfloat *)params
1403 );
1404
1405exit:
1406 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001407 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001408 JNI_ABORT);
1409 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001410 if (_exception) {
1411 jniThrowException(_env, _exceptionType, _exceptionMessage);
1412 }
Jack Palevich27f80022009-04-15 19:13:17 -07001413}
1414
1415/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1416static void
1417android_glLightModelfv__ILjava_nio_FloatBuffer_2
1418 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001419 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001420 const char * _exceptionType = NULL;
1421 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001422 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001423 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001424 jint _remaining;
1425 GLfloat *params = (GLfloat *) 0;
1426
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001427 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001428 int _needed;
1429 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001430#if defined(GL_LIGHT_MODEL_AMBIENT)
1431 case GL_LIGHT_MODEL_AMBIENT:
1432#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1433 _needed = 4;
1434 break;
1435 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001436 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001437 break;
1438 }
1439 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001440 _exception = 1;
1441 _exceptionType = "java/lang/IllegalArgumentException";
1442 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001443 goto exit;
1444 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001445 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001446 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001447 params = (GLfloat *) (_paramsBase + _bufferOffset);
1448 }
Jack Palevich27f80022009-04-15 19:13:17 -07001449 glLightModelfv(
1450 (GLenum)pname,
1451 (GLfloat *)params
1452 );
1453
1454exit:
1455 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001456 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001457 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001458 if (_exception) {
1459 jniThrowException(_env, _exceptionType, _exceptionMessage);
1460 }
Jack Palevich27f80022009-04-15 19:13:17 -07001461}
1462
1463/* void glLightModelx ( GLenum pname, GLfixed param ) */
1464static void
1465android_glLightModelx__II
1466 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1467 glLightModelx(
1468 (GLenum)pname,
1469 (GLfixed)param
1470 );
1471}
1472
1473/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1474static void
1475android_glLightModelxv__I_3II
1476 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001477 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001478 const char * _exceptionType = NULL;
1479 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001480 GLfixed *params_base = (GLfixed *) 0;
1481 jint _remaining;
1482 GLfixed *params = (GLfixed *) 0;
1483
1484 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001485 _exception = 1;
1486 _exceptionType = "java/lang/IllegalArgumentException";
1487 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001488 goto exit;
1489 }
1490 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001491 _exception = 1;
1492 _exceptionType = "java/lang/IllegalArgumentException";
1493 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001494 goto exit;
1495 }
1496 _remaining = _env->GetArrayLength(params_ref) - offset;
1497 int _needed;
1498 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001499#if defined(GL_LIGHT_MODEL_AMBIENT)
1500 case GL_LIGHT_MODEL_AMBIENT:
1501#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1502 _needed = 4;
1503 break;
1504 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001505 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001506 break;
1507 }
1508 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001509 _exception = 1;
1510 _exceptionType = "java/lang/IllegalArgumentException";
1511 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001512 goto exit;
1513 }
1514 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001515 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001516 params = params_base + offset;
1517
1518 glLightModelxv(
1519 (GLenum)pname,
1520 (GLfixed *)params
1521 );
1522
1523exit:
1524 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001525 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001526 JNI_ABORT);
1527 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001528 if (_exception) {
1529 jniThrowException(_env, _exceptionType, _exceptionMessage);
1530 }
Jack Palevich27f80022009-04-15 19:13:17 -07001531}
1532
1533/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1534static void
1535android_glLightModelxv__ILjava_nio_IntBuffer_2
1536 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001537 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001538 const char * _exceptionType = NULL;
1539 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001540 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001541 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001542 jint _remaining;
1543 GLfixed *params = (GLfixed *) 0;
1544
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001545 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001546 int _needed;
1547 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001548#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:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001554 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001555 break;
1556 }
1557 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001558 _exception = 1;
1559 _exceptionType = "java/lang/IllegalArgumentException";
1560 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001561 goto exit;
1562 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001563 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001564 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001565 params = (GLfixed *) (_paramsBase + _bufferOffset);
1566 }
Jack Palevich27f80022009-04-15 19:13:17 -07001567 glLightModelxv(
1568 (GLenum)pname,
1569 (GLfixed *)params
1570 );
1571
1572exit:
1573 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001574 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001575 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001576 if (_exception) {
1577 jniThrowException(_env, _exceptionType, _exceptionMessage);
1578 }
Jack Palevich27f80022009-04-15 19:13:17 -07001579}
1580
1581/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
1582static void
1583android_glLightf__IIF
1584 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
1585 glLightf(
1586 (GLenum)light,
1587 (GLenum)pname,
1588 (GLfloat)param
1589 );
1590}
1591
1592/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1593static void
1594android_glLightfv__II_3FI
1595 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001596 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001597 const char * _exceptionType = NULL;
1598 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001599 GLfloat *params_base = (GLfloat *) 0;
1600 jint _remaining;
1601 GLfloat *params = (GLfloat *) 0;
1602
1603 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001604 _exception = 1;
1605 _exceptionType = "java/lang/IllegalArgumentException";
1606 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001607 goto exit;
1608 }
1609 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001610 _exception = 1;
1611 _exceptionType = "java/lang/IllegalArgumentException";
1612 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001613 goto exit;
1614 }
1615 _remaining = _env->GetArrayLength(params_ref) - offset;
1616 int _needed;
1617 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001618#if defined(GL_SPOT_DIRECTION)
1619 case GL_SPOT_DIRECTION:
1620#endif // defined(GL_SPOT_DIRECTION)
1621 _needed = 3;
1622 break;
1623#if defined(GL_AMBIENT)
1624 case GL_AMBIENT:
1625#endif // defined(GL_AMBIENT)
1626#if defined(GL_DIFFUSE)
1627 case GL_DIFFUSE:
1628#endif // defined(GL_DIFFUSE)
1629#if defined(GL_SPECULAR)
1630 case GL_SPECULAR:
1631#endif // defined(GL_SPECULAR)
1632#if defined(GL_EMISSION)
1633 case GL_EMISSION:
1634#endif // defined(GL_EMISSION)
1635 _needed = 4;
1636 break;
1637 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001638 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001639 break;
1640 }
1641 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001642 _exception = 1;
1643 _exceptionType = "java/lang/IllegalArgumentException";
1644 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001645 goto exit;
1646 }
1647 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001648 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001649 params = params_base + offset;
1650
1651 glLightfv(
1652 (GLenum)light,
1653 (GLenum)pname,
1654 (GLfloat *)params
1655 );
1656
1657exit:
1658 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001659 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001660 JNI_ABORT);
1661 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001662 if (_exception) {
1663 jniThrowException(_env, _exceptionType, _exceptionMessage);
1664 }
Jack Palevich27f80022009-04-15 19:13:17 -07001665}
1666
1667/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1668static void
1669android_glLightfv__IILjava_nio_FloatBuffer_2
1670 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001671 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001672 const char * _exceptionType = NULL;
1673 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001674 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001675 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001676 jint _remaining;
1677 GLfloat *params = (GLfloat *) 0;
1678
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001679 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001680 int _needed;
1681 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001682#if defined(GL_SPOT_DIRECTION)
1683 case GL_SPOT_DIRECTION:
1684#endif // defined(GL_SPOT_DIRECTION)
1685 _needed = 3;
1686 break;
1687#if defined(GL_AMBIENT)
1688 case GL_AMBIENT:
1689#endif // defined(GL_AMBIENT)
1690#if defined(GL_DIFFUSE)
1691 case GL_DIFFUSE:
1692#endif // defined(GL_DIFFUSE)
1693#if defined(GL_SPECULAR)
1694 case GL_SPECULAR:
1695#endif // defined(GL_SPECULAR)
1696#if defined(GL_EMISSION)
1697 case GL_EMISSION:
1698#endif // defined(GL_EMISSION)
1699 _needed = 4;
1700 break;
1701 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001702 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001703 break;
1704 }
1705 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001706 _exception = 1;
1707 _exceptionType = "java/lang/IllegalArgumentException";
1708 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001709 goto exit;
1710 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001711 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001712 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001713 params = (GLfloat *) (_paramsBase + _bufferOffset);
1714 }
Jack Palevich27f80022009-04-15 19:13:17 -07001715 glLightfv(
1716 (GLenum)light,
1717 (GLenum)pname,
1718 (GLfloat *)params
1719 );
1720
1721exit:
1722 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001723 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001724 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001725 if (_exception) {
1726 jniThrowException(_env, _exceptionType, _exceptionMessage);
1727 }
Jack Palevich27f80022009-04-15 19:13:17 -07001728}
1729
1730/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
1731static void
1732android_glLightx__III
1733 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
1734 glLightx(
1735 (GLenum)light,
1736 (GLenum)pname,
1737 (GLfixed)param
1738 );
1739}
1740
1741/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1742static void
1743android_glLightxv__II_3II
1744 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001745 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001746 const char * _exceptionType = NULL;
1747 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001748 GLfixed *params_base = (GLfixed *) 0;
1749 jint _remaining;
1750 GLfixed *params = (GLfixed *) 0;
1751
1752 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001753 _exception = 1;
1754 _exceptionType = "java/lang/IllegalArgumentException";
1755 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001756 goto exit;
1757 }
1758 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001759 _exception = 1;
1760 _exceptionType = "java/lang/IllegalArgumentException";
1761 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001762 goto exit;
1763 }
1764 _remaining = _env->GetArrayLength(params_ref) - offset;
1765 int _needed;
1766 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001767#if defined(GL_SPOT_DIRECTION)
1768 case GL_SPOT_DIRECTION:
1769#endif // defined(GL_SPOT_DIRECTION)
1770 _needed = 3;
1771 break;
1772#if defined(GL_AMBIENT)
1773 case GL_AMBIENT:
1774#endif // defined(GL_AMBIENT)
1775#if defined(GL_DIFFUSE)
1776 case GL_DIFFUSE:
1777#endif // defined(GL_DIFFUSE)
1778#if defined(GL_SPECULAR)
1779 case GL_SPECULAR:
1780#endif // defined(GL_SPECULAR)
1781#if defined(GL_EMISSION)
1782 case GL_EMISSION:
1783#endif // defined(GL_EMISSION)
1784 _needed = 4;
1785 break;
1786 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001787 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001788 break;
1789 }
1790 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001791 _exception = 1;
1792 _exceptionType = "java/lang/IllegalArgumentException";
1793 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001794 goto exit;
1795 }
1796 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001797 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001798 params = params_base + offset;
1799
1800 glLightxv(
1801 (GLenum)light,
1802 (GLenum)pname,
1803 (GLfixed *)params
1804 );
1805
1806exit:
1807 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001808 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001809 JNI_ABORT);
1810 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001811 if (_exception) {
1812 jniThrowException(_env, _exceptionType, _exceptionMessage);
1813 }
Jack Palevich27f80022009-04-15 19:13:17 -07001814}
1815
1816/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1817static void
1818android_glLightxv__IILjava_nio_IntBuffer_2
1819 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001820 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001821 const char * _exceptionType = NULL;
1822 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001823 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001824 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001825 jint _remaining;
1826 GLfixed *params = (GLfixed *) 0;
1827
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001828 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001829 int _needed;
1830 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001831#if defined(GL_SPOT_DIRECTION)
1832 case GL_SPOT_DIRECTION:
1833#endif // defined(GL_SPOT_DIRECTION)
1834 _needed = 3;
1835 break;
1836#if defined(GL_AMBIENT)
1837 case GL_AMBIENT:
1838#endif // defined(GL_AMBIENT)
1839#if defined(GL_DIFFUSE)
1840 case GL_DIFFUSE:
1841#endif // defined(GL_DIFFUSE)
1842#if defined(GL_SPECULAR)
1843 case GL_SPECULAR:
1844#endif // defined(GL_SPECULAR)
1845#if defined(GL_EMISSION)
1846 case GL_EMISSION:
1847#endif // defined(GL_EMISSION)
1848 _needed = 4;
1849 break;
1850 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001851 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001852 break;
1853 }
1854 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001855 _exception = 1;
1856 _exceptionType = "java/lang/IllegalArgumentException";
1857 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001858 goto exit;
1859 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001860 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001861 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001862 params = (GLfixed *) (_paramsBase + _bufferOffset);
1863 }
Jack Palevich27f80022009-04-15 19:13:17 -07001864 glLightxv(
1865 (GLenum)light,
1866 (GLenum)pname,
1867 (GLfixed *)params
1868 );
1869
1870exit:
1871 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001872 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001873 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001874 if (_exception) {
1875 jniThrowException(_env, _exceptionType, _exceptionMessage);
1876 }
Jack Palevich27f80022009-04-15 19:13:17 -07001877}
1878
1879/* void glLineWidth ( GLfloat width ) */
1880static void
1881android_glLineWidth__F
1882 (JNIEnv *_env, jobject _this, jfloat width) {
1883 glLineWidth(
1884 (GLfloat)width
1885 );
1886}
1887
1888/* void glLineWidthx ( GLfixed width ) */
1889static void
1890android_glLineWidthx__I
1891 (JNIEnv *_env, jobject _this, jint width) {
1892 glLineWidthx(
1893 (GLfixed)width
1894 );
1895}
1896
1897/* void glLoadIdentity ( void ) */
1898static void
1899android_glLoadIdentity__
1900 (JNIEnv *_env, jobject _this) {
1901 glLoadIdentity();
1902}
1903
1904/* void glLoadMatrixf ( const GLfloat *m ) */
1905static void
1906android_glLoadMatrixf___3FI
1907 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001908 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001909 const char * _exceptionType = NULL;
1910 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001911 GLfloat *m_base = (GLfloat *) 0;
1912 jint _remaining;
1913 GLfloat *m = (GLfloat *) 0;
1914
1915 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001916 _exception = 1;
1917 _exceptionType = "java/lang/IllegalArgumentException";
1918 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001919 goto exit;
1920 }
1921 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001922 _exception = 1;
1923 _exceptionType = "java/lang/IllegalArgumentException";
1924 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001925 goto exit;
1926 }
1927 _remaining = _env->GetArrayLength(m_ref) - offset;
1928 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001929 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001930 m = m_base + offset;
1931
1932 glLoadMatrixf(
1933 (GLfloat *)m
1934 );
1935
1936exit:
1937 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001938 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001939 JNI_ABORT);
1940 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001941 if (_exception) {
1942 jniThrowException(_env, _exceptionType, _exceptionMessage);
1943 }
Jack Palevich27f80022009-04-15 19:13:17 -07001944}
1945
1946/* void glLoadMatrixf ( const GLfloat *m ) */
1947static void
1948android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
1949 (JNIEnv *_env, jobject _this, jobject m_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001950 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001951 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001952 jint _remaining;
1953 GLfloat *m = (GLfloat *) 0;
1954
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001955 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001956 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001957 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001958 m = (GLfloat *) (_mBase + _bufferOffset);
1959 }
Jack Palevich27f80022009-04-15 19:13:17 -07001960 glLoadMatrixf(
1961 (GLfloat *)m
1962 );
1963 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001964 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001965 }
1966}
1967
1968/* void glLoadMatrixx ( const GLfixed *m ) */
1969static void
1970android_glLoadMatrixx___3II
1971 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001972 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001973 const char * _exceptionType = NULL;
1974 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001975 GLfixed *m_base = (GLfixed *) 0;
1976 jint _remaining;
1977 GLfixed *m = (GLfixed *) 0;
1978
1979 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001980 _exception = 1;
1981 _exceptionType = "java/lang/IllegalArgumentException";
1982 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001983 goto exit;
1984 }
1985 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001986 _exception = 1;
1987 _exceptionType = "java/lang/IllegalArgumentException";
1988 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001989 goto exit;
1990 }
1991 _remaining = _env->GetArrayLength(m_ref) - offset;
1992 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001993 _env->GetIntArrayElements(m_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001994 m = m_base + offset;
1995
1996 glLoadMatrixx(
1997 (GLfixed *)m
1998 );
1999
2000exit:
2001 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002002 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002003 JNI_ABORT);
2004 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002005 if (_exception) {
2006 jniThrowException(_env, _exceptionType, _exceptionMessage);
2007 }
Jack Palevich27f80022009-04-15 19:13:17 -07002008}
2009
2010/* void glLoadMatrixx ( const GLfixed *m ) */
2011static void
2012android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2013 (JNIEnv *_env, jobject _this, jobject m_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002014 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002015 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002016 jint _remaining;
2017 GLfixed *m = (GLfixed *) 0;
2018
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002019 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002020 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002021 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002022 m = (GLfixed *) (_mBase + _bufferOffset);
2023 }
Jack Palevich27f80022009-04-15 19:13:17 -07002024 glLoadMatrixx(
2025 (GLfixed *)m
2026 );
2027 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002028 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002029 }
2030}
2031
2032/* void glLogicOp ( GLenum opcode ) */
2033static void
2034android_glLogicOp__I
2035 (JNIEnv *_env, jobject _this, jint opcode) {
2036 glLogicOp(
2037 (GLenum)opcode
2038 );
2039}
2040
2041/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2042static void
2043android_glMaterialf__IIF
2044 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2045 glMaterialf(
2046 (GLenum)face,
2047 (GLenum)pname,
2048 (GLfloat)param
2049 );
2050}
2051
2052/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2053static void
2054android_glMaterialfv__II_3FI
2055 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002056 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002057 const char * _exceptionType = NULL;
2058 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002059 GLfloat *params_base = (GLfloat *) 0;
2060 jint _remaining;
2061 GLfloat *params = (GLfloat *) 0;
2062
2063 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002064 _exception = 1;
2065 _exceptionType = "java/lang/IllegalArgumentException";
2066 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002067 goto exit;
2068 }
2069 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002070 _exception = 1;
2071 _exceptionType = "java/lang/IllegalArgumentException";
2072 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002073 goto exit;
2074 }
2075 _remaining = _env->GetArrayLength(params_ref) - offset;
2076 int _needed;
2077 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002078#if defined(GL_AMBIENT)
2079 case GL_AMBIENT:
2080#endif // defined(GL_AMBIENT)
2081#if defined(GL_DIFFUSE)
2082 case GL_DIFFUSE:
2083#endif // defined(GL_DIFFUSE)
2084#if defined(GL_SPECULAR)
2085 case GL_SPECULAR:
2086#endif // defined(GL_SPECULAR)
2087#if defined(GL_EMISSION)
2088 case GL_EMISSION:
2089#endif // defined(GL_EMISSION)
2090#if defined(GL_AMBIENT_AND_DIFFUSE)
2091 case GL_AMBIENT_AND_DIFFUSE:
2092#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2093 _needed = 4;
2094 break;
2095 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002096 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002097 break;
2098 }
2099 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002100 _exception = 1;
2101 _exceptionType = "java/lang/IllegalArgumentException";
2102 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002103 goto exit;
2104 }
2105 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002106 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002107 params = params_base + offset;
2108
2109 glMaterialfv(
2110 (GLenum)face,
2111 (GLenum)pname,
2112 (GLfloat *)params
2113 );
2114
2115exit:
2116 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002117 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002118 JNI_ABORT);
2119 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002120 if (_exception) {
2121 jniThrowException(_env, _exceptionType, _exceptionMessage);
2122 }
Jack Palevich27f80022009-04-15 19:13:17 -07002123}
2124
2125/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2126static void
2127android_glMaterialfv__IILjava_nio_FloatBuffer_2
2128 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002129 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002130 const char * _exceptionType = NULL;
2131 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002132 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002133 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002134 jint _remaining;
2135 GLfloat *params = (GLfloat *) 0;
2136
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002137 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002138 int _needed;
2139 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002140#if defined(GL_AMBIENT)
2141 case GL_AMBIENT:
2142#endif // defined(GL_AMBIENT)
2143#if defined(GL_DIFFUSE)
2144 case GL_DIFFUSE:
2145#endif // defined(GL_DIFFUSE)
2146#if defined(GL_SPECULAR)
2147 case GL_SPECULAR:
2148#endif // defined(GL_SPECULAR)
2149#if defined(GL_EMISSION)
2150 case GL_EMISSION:
2151#endif // defined(GL_EMISSION)
2152#if defined(GL_AMBIENT_AND_DIFFUSE)
2153 case GL_AMBIENT_AND_DIFFUSE:
2154#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2155 _needed = 4;
2156 break;
2157 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002158 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002159 break;
2160 }
2161 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002162 _exception = 1;
2163 _exceptionType = "java/lang/IllegalArgumentException";
2164 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002165 goto exit;
2166 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002167 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002168 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002169 params = (GLfloat *) (_paramsBase + _bufferOffset);
2170 }
Jack Palevich27f80022009-04-15 19:13:17 -07002171 glMaterialfv(
2172 (GLenum)face,
2173 (GLenum)pname,
2174 (GLfloat *)params
2175 );
2176
2177exit:
2178 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002179 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002180 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002181 if (_exception) {
2182 jniThrowException(_env, _exceptionType, _exceptionMessage);
2183 }
Jack Palevich27f80022009-04-15 19:13:17 -07002184}
2185
2186/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
2187static void
2188android_glMaterialx__III
2189 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
2190 glMaterialx(
2191 (GLenum)face,
2192 (GLenum)pname,
2193 (GLfixed)param
2194 );
2195}
2196
2197/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2198static void
2199android_glMaterialxv__II_3II
2200 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002201 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002202 const char * _exceptionType = NULL;
2203 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002204 GLfixed *params_base = (GLfixed *) 0;
2205 jint _remaining;
2206 GLfixed *params = (GLfixed *) 0;
2207
2208 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002209 _exception = 1;
2210 _exceptionType = "java/lang/IllegalArgumentException";
2211 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002212 goto exit;
2213 }
2214 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002215 _exception = 1;
2216 _exceptionType = "java/lang/IllegalArgumentException";
2217 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002218 goto exit;
2219 }
2220 _remaining = _env->GetArrayLength(params_ref) - offset;
2221 int _needed;
2222 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002223#if defined(GL_AMBIENT)
2224 case GL_AMBIENT:
2225#endif // defined(GL_AMBIENT)
2226#if defined(GL_DIFFUSE)
2227 case GL_DIFFUSE:
2228#endif // defined(GL_DIFFUSE)
2229#if defined(GL_SPECULAR)
2230 case GL_SPECULAR:
2231#endif // defined(GL_SPECULAR)
2232#if defined(GL_EMISSION)
2233 case GL_EMISSION:
2234#endif // defined(GL_EMISSION)
2235#if defined(GL_AMBIENT_AND_DIFFUSE)
2236 case GL_AMBIENT_AND_DIFFUSE:
2237#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2238 _needed = 4;
2239 break;
2240 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002241 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002242 break;
2243 }
2244 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002245 _exception = 1;
2246 _exceptionType = "java/lang/IllegalArgumentException";
2247 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002248 goto exit;
2249 }
2250 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002251 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002252 params = params_base + offset;
2253
2254 glMaterialxv(
2255 (GLenum)face,
2256 (GLenum)pname,
2257 (GLfixed *)params
2258 );
2259
2260exit:
2261 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002262 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002263 JNI_ABORT);
2264 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002265 if (_exception) {
2266 jniThrowException(_env, _exceptionType, _exceptionMessage);
2267 }
Jack Palevich27f80022009-04-15 19:13:17 -07002268}
2269
2270/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2271static void
2272android_glMaterialxv__IILjava_nio_IntBuffer_2
2273 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002274 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002275 const char * _exceptionType = NULL;
2276 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002277 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002278 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002279 jint _remaining;
2280 GLfixed *params = (GLfixed *) 0;
2281
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002282 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002283 int _needed;
2284 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002285#if defined(GL_AMBIENT)
2286 case GL_AMBIENT:
2287#endif // defined(GL_AMBIENT)
2288#if defined(GL_DIFFUSE)
2289 case GL_DIFFUSE:
2290#endif // defined(GL_DIFFUSE)
2291#if defined(GL_SPECULAR)
2292 case GL_SPECULAR:
2293#endif // defined(GL_SPECULAR)
2294#if defined(GL_EMISSION)
2295 case GL_EMISSION:
2296#endif // defined(GL_EMISSION)
2297#if defined(GL_AMBIENT_AND_DIFFUSE)
2298 case GL_AMBIENT_AND_DIFFUSE:
2299#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2300 _needed = 4;
2301 break;
2302 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002303 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002304 break;
2305 }
2306 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002307 _exception = 1;
2308 _exceptionType = "java/lang/IllegalArgumentException";
2309 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002310 goto exit;
2311 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002312 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002313 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002314 params = (GLfixed *) (_paramsBase + _bufferOffset);
2315 }
Jack Palevich27f80022009-04-15 19:13:17 -07002316 glMaterialxv(
2317 (GLenum)face,
2318 (GLenum)pname,
2319 (GLfixed *)params
2320 );
2321
2322exit:
2323 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002324 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002325 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002326 if (_exception) {
2327 jniThrowException(_env, _exceptionType, _exceptionMessage);
2328 }
Jack Palevich27f80022009-04-15 19:13:17 -07002329}
2330
2331/* void glMatrixMode ( GLenum mode ) */
2332static void
2333android_glMatrixMode__I
2334 (JNIEnv *_env, jobject _this, jint mode) {
2335 glMatrixMode(
2336 (GLenum)mode
2337 );
2338}
2339
2340/* void glMultMatrixf ( const GLfloat *m ) */
2341static void
2342android_glMultMatrixf___3FI
2343 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002344 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002345 const char * _exceptionType = NULL;
2346 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002347 GLfloat *m_base = (GLfloat *) 0;
2348 jint _remaining;
2349 GLfloat *m = (GLfloat *) 0;
2350
2351 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002352 _exception = 1;
2353 _exceptionType = "java/lang/IllegalArgumentException";
2354 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002355 goto exit;
2356 }
2357 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002358 _exception = 1;
2359 _exceptionType = "java/lang/IllegalArgumentException";
2360 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002361 goto exit;
2362 }
2363 _remaining = _env->GetArrayLength(m_ref) - offset;
2364 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002365 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002366 m = m_base + offset;
2367
2368 glMultMatrixf(
2369 (GLfloat *)m
2370 );
2371
2372exit:
2373 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002374 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002375 JNI_ABORT);
2376 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002377 if (_exception) {
2378 jniThrowException(_env, _exceptionType, _exceptionMessage);
2379 }
Jack Palevich27f80022009-04-15 19:13:17 -07002380}
2381
2382/* void glMultMatrixf ( const GLfloat *m ) */
2383static void
2384android_glMultMatrixf__Ljava_nio_FloatBuffer_2
2385 (JNIEnv *_env, jobject _this, jobject m_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002386 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002387 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002388 jint _remaining;
2389 GLfloat *m = (GLfloat *) 0;
2390
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002391 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002392 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002393 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002394 m = (GLfloat *) (_mBase + _bufferOffset);
2395 }
Jack Palevich27f80022009-04-15 19:13:17 -07002396 glMultMatrixf(
2397 (GLfloat *)m
2398 );
2399 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002400 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002401 }
2402}
2403
2404/* void glMultMatrixx ( const GLfixed *m ) */
2405static void
2406android_glMultMatrixx___3II
2407 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002408 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002409 const char * _exceptionType = NULL;
2410 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002411 GLfixed *m_base = (GLfixed *) 0;
2412 jint _remaining;
2413 GLfixed *m = (GLfixed *) 0;
2414
2415 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002416 _exception = 1;
2417 _exceptionType = "java/lang/IllegalArgumentException";
2418 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002419 goto exit;
2420 }
2421 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002422 _exception = 1;
2423 _exceptionType = "java/lang/IllegalArgumentException";
2424 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002425 goto exit;
2426 }
2427 _remaining = _env->GetArrayLength(m_ref) - offset;
2428 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002429 _env->GetIntArrayElements(m_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002430 m = m_base + offset;
2431
2432 glMultMatrixx(
2433 (GLfixed *)m
2434 );
2435
2436exit:
2437 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002438 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002439 JNI_ABORT);
2440 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002441 if (_exception) {
2442 jniThrowException(_env, _exceptionType, _exceptionMessage);
2443 }
Jack Palevich27f80022009-04-15 19:13:17 -07002444}
2445
2446/* void glMultMatrixx ( const GLfixed *m ) */
2447static void
2448android_glMultMatrixx__Ljava_nio_IntBuffer_2
2449 (JNIEnv *_env, jobject _this, jobject m_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002450 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002451 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002452 jint _remaining;
2453 GLfixed *m = (GLfixed *) 0;
2454
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002455 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002456 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002457 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002458 m = (GLfixed *) (_mBase + _bufferOffset);
2459 }
Jack Palevich27f80022009-04-15 19:13:17 -07002460 glMultMatrixx(
2461 (GLfixed *)m
2462 );
2463 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002464 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002465 }
2466}
2467
2468/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
2469static void
2470android_glMultiTexCoord4f__IFFFF
2471 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
2472 glMultiTexCoord4f(
2473 (GLenum)target,
2474 (GLfloat)s,
2475 (GLfloat)t,
2476 (GLfloat)r,
2477 (GLfloat)q
2478 );
2479}
2480
2481/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
2482static void
2483android_glMultiTexCoord4x__IIIII
2484 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
2485 glMultiTexCoord4x(
2486 (GLenum)target,
2487 (GLfixed)s,
2488 (GLfixed)t,
2489 (GLfixed)r,
2490 (GLfixed)q
2491 );
2492}
2493
2494/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
2495static void
2496android_glNormal3f__FFF
2497 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
2498 glNormal3f(
2499 (GLfloat)nx,
2500 (GLfloat)ny,
2501 (GLfloat)nz
2502 );
2503}
2504
2505/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
2506static void
2507android_glNormal3x__III
2508 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
2509 glNormal3x(
2510 (GLfixed)nx,
2511 (GLfixed)ny,
2512 (GLfixed)nz
2513 );
2514}
2515
2516/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
2517static void
2518android_glNormalPointerBounds__IILjava_nio_Buffer_2I
2519 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
2520 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002521 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002522 jint _remaining;
2523 GLvoid *pointer = (GLvoid *) 0;
2524
Jack Paleviche20ea782009-05-07 18:28:29 -07002525 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07002526 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07002527 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07002528 return;
2529 }
2530 }
Jack Palevich27f80022009-04-15 19:13:17 -07002531 glNormalPointerBounds(
2532 (GLenum)type,
2533 (GLsizei)stride,
2534 (GLvoid *)pointer,
2535 (GLsizei)remaining
2536 );
Jack Palevich27f80022009-04-15 19:13:17 -07002537}
2538
2539/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
2540static void
2541android_glOrthof__FFFFFF
2542 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
2543 glOrthof(
2544 (GLfloat)left,
2545 (GLfloat)right,
2546 (GLfloat)bottom,
2547 (GLfloat)top,
2548 (GLfloat)zNear,
2549 (GLfloat)zFar
2550 );
2551}
2552
2553/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
2554static void
2555android_glOrthox__IIIIII
2556 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
2557 glOrthox(
2558 (GLfixed)left,
2559 (GLfixed)right,
2560 (GLfixed)bottom,
2561 (GLfixed)top,
2562 (GLfixed)zNear,
2563 (GLfixed)zFar
2564 );
2565}
2566
2567/* void glPixelStorei ( GLenum pname, GLint param ) */
2568static void
2569android_glPixelStorei__II
2570 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2571 glPixelStorei(
2572 (GLenum)pname,
2573 (GLint)param
2574 );
2575}
2576
2577/* void glPointSize ( GLfloat size ) */
2578static void
2579android_glPointSize__F
2580 (JNIEnv *_env, jobject _this, jfloat size) {
2581 glPointSize(
2582 (GLfloat)size
2583 );
2584}
2585
2586/* void glPointSizex ( GLfixed size ) */
2587static void
2588android_glPointSizex__I
2589 (JNIEnv *_env, jobject _this, jint size) {
2590 glPointSizex(
2591 (GLfixed)size
2592 );
2593}
2594
2595/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
2596static void
2597android_glPolygonOffset__FF
2598 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
2599 glPolygonOffset(
2600 (GLfloat)factor,
2601 (GLfloat)units
2602 );
2603}
2604
2605/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
2606static void
2607android_glPolygonOffsetx__II
2608 (JNIEnv *_env, jobject _this, jint factor, jint units) {
2609 glPolygonOffsetx(
2610 (GLfixed)factor,
2611 (GLfixed)units
2612 );
2613}
2614
2615/* void glPopMatrix ( void ) */
2616static void
2617android_glPopMatrix__
2618 (JNIEnv *_env, jobject _this) {
2619 glPopMatrix();
2620}
2621
2622/* void glPushMatrix ( void ) */
2623static void
2624android_glPushMatrix__
2625 (JNIEnv *_env, jobject _this) {
2626 glPushMatrix();
2627}
2628
2629/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
2630static void
2631android_glReadPixels__IIIIIILjava_nio_Buffer_2
2632 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
Jack Palevich27f80022009-04-15 19:13:17 -07002633 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002634 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002635 jint _remaining;
2636 GLvoid *pixels = (GLvoid *) 0;
2637
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002638 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002639 if (pixels == NULL) {
2640 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2641 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
2642 }
Jack Palevich27f80022009-04-15 19:13:17 -07002643 glReadPixels(
2644 (GLint)x,
2645 (GLint)y,
2646 (GLsizei)width,
2647 (GLsizei)height,
2648 (GLenum)format,
2649 (GLenum)type,
2650 (GLvoid *)pixels
2651 );
2652 if (_array) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002653 releasePointer(_env, _array, pixels, JNI_TRUE);
Jack Palevich27f80022009-04-15 19:13:17 -07002654 }
2655}
2656
2657/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
2658static void
2659android_glRotatef__FFFF
2660 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
2661 glRotatef(
2662 (GLfloat)angle,
2663 (GLfloat)x,
2664 (GLfloat)y,
2665 (GLfloat)z
2666 );
2667}
2668
2669/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
2670static void
2671android_glRotatex__IIII
2672 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
2673 glRotatex(
2674 (GLfixed)angle,
2675 (GLfixed)x,
2676 (GLfixed)y,
2677 (GLfixed)z
2678 );
2679}
2680
2681/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
2682static void
2683android_glSampleCoverage__FZ
2684 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
2685 glSampleCoverage(
2686 (GLclampf)value,
2687 (GLboolean)invert
2688 );
2689}
2690
2691/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
2692static void
2693android_glSampleCoveragex__IZ
2694 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
2695 glSampleCoveragex(
2696 (GLclampx)value,
2697 (GLboolean)invert
2698 );
2699}
2700
2701/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
2702static void
2703android_glScalef__FFF
2704 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
2705 glScalef(
2706 (GLfloat)x,
2707 (GLfloat)y,
2708 (GLfloat)z
2709 );
2710}
2711
2712/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
2713static void
2714android_glScalex__III
2715 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
2716 glScalex(
2717 (GLfixed)x,
2718 (GLfixed)y,
2719 (GLfixed)z
2720 );
2721}
2722
2723/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
2724static void
2725android_glScissor__IIII
2726 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
2727 glScissor(
2728 (GLint)x,
2729 (GLint)y,
2730 (GLsizei)width,
2731 (GLsizei)height
2732 );
2733}
2734
2735/* void glShadeModel ( GLenum mode ) */
2736static void
2737android_glShadeModel__I
2738 (JNIEnv *_env, jobject _this, jint mode) {
2739 glShadeModel(
2740 (GLenum)mode
2741 );
2742}
2743
2744/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
2745static void
2746android_glStencilFunc__III
2747 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
2748 glStencilFunc(
2749 (GLenum)func,
2750 (GLint)ref,
2751 (GLuint)mask
2752 );
2753}
2754
2755/* void glStencilMask ( GLuint mask ) */
2756static void
2757android_glStencilMask__I
2758 (JNIEnv *_env, jobject _this, jint mask) {
2759 glStencilMask(
2760 (GLuint)mask
2761 );
2762}
2763
2764/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
2765static void
2766android_glStencilOp__III
2767 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
2768 glStencilOp(
2769 (GLenum)fail,
2770 (GLenum)zfail,
2771 (GLenum)zpass
2772 );
2773}
2774
2775/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2776static void
2777android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
2778 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
2779 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002780 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002781 jint _remaining;
2782 GLvoid *pointer = (GLvoid *) 0;
2783
Jack Paleviche20ea782009-05-07 18:28:29 -07002784 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07002785 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07002786 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07002787 return;
2788 }
2789 }
Jack Palevich27f80022009-04-15 19:13:17 -07002790 glTexCoordPointerBounds(
2791 (GLint)size,
2792 (GLenum)type,
2793 (GLsizei)stride,
2794 (GLvoid *)pointer,
2795 (GLsizei)remaining
2796 );
Jack Palevich27f80022009-04-15 19:13:17 -07002797}
2798
2799/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
2800static void
2801android_glTexEnvf__IIF
2802 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
2803 glTexEnvf(
2804 (GLenum)target,
2805 (GLenum)pname,
2806 (GLfloat)param
2807 );
2808}
2809
2810/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2811static void
2812android_glTexEnvfv__II_3FI
2813 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002814 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002815 const char * _exceptionType = NULL;
2816 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002817 GLfloat *params_base = (GLfloat *) 0;
2818 jint _remaining;
2819 GLfloat *params = (GLfloat *) 0;
2820
2821 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002822 _exception = 1;
2823 _exceptionType = "java/lang/IllegalArgumentException";
2824 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002825 goto exit;
2826 }
2827 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002828 _exception = 1;
2829 _exceptionType = "java/lang/IllegalArgumentException";
2830 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002831 goto exit;
2832 }
2833 _remaining = _env->GetArrayLength(params_ref) - offset;
2834 int _needed;
2835 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002836#if defined(GL_TEXTURE_ENV_COLOR)
2837 case GL_TEXTURE_ENV_COLOR:
2838#endif // defined(GL_TEXTURE_ENV_COLOR)
2839 _needed = 4;
2840 break;
2841 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002842 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002843 break;
2844 }
2845 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002846 _exception = 1;
2847 _exceptionType = "java/lang/IllegalArgumentException";
2848 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002849 goto exit;
2850 }
2851 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002852 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002853 params = params_base + offset;
2854
2855 glTexEnvfv(
2856 (GLenum)target,
2857 (GLenum)pname,
2858 (GLfloat *)params
2859 );
2860
2861exit:
2862 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002863 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002864 JNI_ABORT);
2865 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002866 if (_exception) {
2867 jniThrowException(_env, _exceptionType, _exceptionMessage);
2868 }
Jack Palevich27f80022009-04-15 19:13:17 -07002869}
2870
2871/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2872static void
2873android_glTexEnvfv__IILjava_nio_FloatBuffer_2
2874 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002875 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002876 const char * _exceptionType = NULL;
2877 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002878 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002879 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002880 jint _remaining;
2881 GLfloat *params = (GLfloat *) 0;
2882
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002883 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002884 int _needed;
2885 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002886#if defined(GL_TEXTURE_ENV_COLOR)
2887 case GL_TEXTURE_ENV_COLOR:
2888#endif // defined(GL_TEXTURE_ENV_COLOR)
2889 _needed = 4;
2890 break;
2891 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002892 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002893 break;
2894 }
2895 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002896 _exception = 1;
2897 _exceptionType = "java/lang/IllegalArgumentException";
2898 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002899 goto exit;
2900 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002901 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002902 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002903 params = (GLfloat *) (_paramsBase + _bufferOffset);
2904 }
Jack Palevich27f80022009-04-15 19:13:17 -07002905 glTexEnvfv(
2906 (GLenum)target,
2907 (GLenum)pname,
2908 (GLfloat *)params
2909 );
2910
2911exit:
2912 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002913 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002914 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002915 if (_exception) {
2916 jniThrowException(_env, _exceptionType, _exceptionMessage);
2917 }
Jack Palevich27f80022009-04-15 19:13:17 -07002918}
2919
2920/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
2921static void
2922android_glTexEnvx__III
2923 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
2924 glTexEnvx(
2925 (GLenum)target,
2926 (GLenum)pname,
2927 (GLfixed)param
2928 );
2929}
2930
2931/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2932static void
2933android_glTexEnvxv__II_3II
2934 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002935 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002936 const char * _exceptionType = NULL;
2937 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002938 GLfixed *params_base = (GLfixed *) 0;
2939 jint _remaining;
2940 GLfixed *params = (GLfixed *) 0;
2941
2942 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002943 _exception = 1;
2944 _exceptionType = "java/lang/IllegalArgumentException";
2945 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002946 goto exit;
2947 }
2948 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002949 _exception = 1;
2950 _exceptionType = "java/lang/IllegalArgumentException";
2951 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002952 goto exit;
2953 }
2954 _remaining = _env->GetArrayLength(params_ref) - offset;
2955 int _needed;
2956 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002957#if defined(GL_TEXTURE_ENV_COLOR)
2958 case GL_TEXTURE_ENV_COLOR:
2959#endif // defined(GL_TEXTURE_ENV_COLOR)
2960 _needed = 4;
2961 break;
2962 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002963 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002964 break;
2965 }
2966 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002967 _exception = 1;
2968 _exceptionType = "java/lang/IllegalArgumentException";
2969 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002970 goto exit;
2971 }
2972 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002973 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002974 params = params_base + offset;
2975
2976 glTexEnvxv(
2977 (GLenum)target,
2978 (GLenum)pname,
2979 (GLfixed *)params
2980 );
2981
2982exit:
2983 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002984 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002985 JNI_ABORT);
2986 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002987 if (_exception) {
2988 jniThrowException(_env, _exceptionType, _exceptionMessage);
2989 }
Jack Palevich27f80022009-04-15 19:13:17 -07002990}
2991
2992/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
2993static void
2994android_glTexEnvxv__IILjava_nio_IntBuffer_2
2995 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002996 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002997 const char * _exceptionType = NULL;
2998 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002999 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003000 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003001 jint _remaining;
3002 GLfixed *params = (GLfixed *) 0;
3003
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003004 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07003005 int _needed;
3006 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07003007#if defined(GL_TEXTURE_ENV_COLOR)
3008 case GL_TEXTURE_ENV_COLOR:
3009#endif // defined(GL_TEXTURE_ENV_COLOR)
3010 _needed = 4;
3011 break;
3012 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003013 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07003014 break;
3015 }
3016 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003017 _exception = 1;
3018 _exceptionType = "java/lang/IllegalArgumentException";
3019 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07003020 goto exit;
3021 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003022 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003023 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003024 params = (GLfixed *) (_paramsBase + _bufferOffset);
3025 }
Jack Palevich27f80022009-04-15 19:13:17 -07003026 glTexEnvxv(
3027 (GLenum)target,
3028 (GLenum)pname,
3029 (GLfixed *)params
3030 );
3031
3032exit:
3033 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003034 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07003035 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003036 if (_exception) {
3037 jniThrowException(_env, _exceptionType, _exceptionMessage);
3038 }
Jack Palevich27f80022009-04-15 19:13:17 -07003039}
3040
3041/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
3042static void
3043android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
3044 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
3045 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003046 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003047 jint _remaining;
3048 GLvoid *pixels = (GLvoid *) 0;
3049
3050 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003051 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003052 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07003053 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003054 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3055 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07003056 }
3057 glTexImage2D(
3058 (GLenum)target,
3059 (GLint)level,
3060 (GLint)internalformat,
3061 (GLsizei)width,
3062 (GLsizei)height,
3063 (GLint)border,
3064 (GLenum)format,
3065 (GLenum)type,
3066 (GLvoid *)pixels
3067 );
3068 if (_array) {
3069 releasePointer(_env, _array, pixels, JNI_FALSE);
3070 }
3071}
3072
3073/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
3074static void
3075android_glTexParameterf__IIF
3076 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3077 glTexParameterf(
3078 (GLenum)target,
3079 (GLenum)pname,
3080 (GLfloat)param
3081 );
3082}
3083
3084/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
3085static void
3086android_glTexParameterx__III
3087 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3088 glTexParameterx(
3089 (GLenum)target,
3090 (GLenum)pname,
3091 (GLfixed)param
3092 );
3093}
3094
3095/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
3096static void
3097android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
3098 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
3099 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003100 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003101 jint _remaining;
3102 GLvoid *pixels = (GLvoid *) 0;
3103
3104 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003105 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003106 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07003107 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003108 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3109 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07003110 }
3111 glTexSubImage2D(
3112 (GLenum)target,
3113 (GLint)level,
3114 (GLint)xoffset,
3115 (GLint)yoffset,
3116 (GLsizei)width,
3117 (GLsizei)height,
3118 (GLenum)format,
3119 (GLenum)type,
3120 (GLvoid *)pixels
3121 );
3122 if (_array) {
3123 releasePointer(_env, _array, pixels, JNI_FALSE);
3124 }
3125}
3126
3127/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
3128static void
3129android_glTranslatef__FFF
3130 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3131 glTranslatef(
3132 (GLfloat)x,
3133 (GLfloat)y,
3134 (GLfloat)z
3135 );
3136}
3137
3138/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
3139static void
3140android_glTranslatex__III
3141 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3142 glTranslatex(
3143 (GLfixed)x,
3144 (GLfixed)y,
3145 (GLfixed)z
3146 );
3147}
3148
3149/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3150static void
3151android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
3152 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
3153 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003154 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003155 jint _remaining;
3156 GLvoid *pointer = (GLvoid *) 0;
3157
Jack Paleviche20ea782009-05-07 18:28:29 -07003158 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003159 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003160 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003161 return;
3162 }
3163 }
Jack Palevich27f80022009-04-15 19:13:17 -07003164 glVertexPointerBounds(
3165 (GLint)size,
3166 (GLenum)type,
3167 (GLsizei)stride,
3168 (GLvoid *)pointer,
3169 (GLsizei)remaining
3170 );
Jack Palevich27f80022009-04-15 19:13:17 -07003171}
3172
3173/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3174static void
3175android_glViewport__IIII
3176 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3177 glViewport(
3178 (GLint)x,
3179 (GLint)y,
3180 (GLsizei)width,
3181 (GLsizei)height
3182 );
3183}
3184
3185static const char *classPathName = "android/opengl/GLES10";
3186
Daniel Micay76f6a862015-09-19 17:31:01 -04003187static const JNINativeMethod methods[] = {
Jack Palevich27f80022009-04-15 19:13:17 -07003188{"_nativeClassInit", "()V", (void*)nativeClassInit },
3189{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
3190{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
3191{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
3192{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
3193{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
3194{"glClear", "(I)V", (void *) android_glClear__I },
3195{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
3196{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
3197{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
3198{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
3199{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
3200{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
3201{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
3202{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
3203{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
3204{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
3205{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
3206{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3207{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
3208{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
3209{"glCullFace", "(I)V", (void *) android_glCullFace__I },
3210{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
3211{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
3212{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
3213{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
3214{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
3215{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
3216{"glDisable", "(I)V", (void *) android_glDisable__I },
3217{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
3218{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
3219{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
3220{"glEnable", "(I)V", (void *) android_glEnable__I },
3221{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
3222{"glFinish", "()V", (void *) android_glFinish__ },
3223{"glFlush", "()V", (void *) android_glFlush__ },
3224{"glFogf", "(IF)V", (void *) android_glFogf__IF },
3225{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
3226{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
3227{"glFogx", "(II)V", (void *) android_glFogx__II },
3228{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
3229{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
3230{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
3231{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
3232{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
3233{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
3234{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
3235{"glGetError", "()I", (void *) android_glGetError__ },
3236{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
3237{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
Jack Palevicha3795852009-04-24 10:35:11 -07003238{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
Jack Palevich27f80022009-04-15 19:13:17 -07003239{"glHint", "(II)V", (void *) android_glHint__II },
3240{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
3241{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
3242{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
3243{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
3244{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
3245{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
3246{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
3247{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
3248{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
3249{"glLightx", "(III)V", (void *) android_glLightx__III },
3250{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
3251{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
3252{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
3253{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
3254{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
3255{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
3256{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
3257{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
3258{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
3259{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
3260{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
3261{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
3262{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
3263{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
3264{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
3265{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
3266{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
3267{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
3268{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
3269{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
3270{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
3271{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
3272{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
3273{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
3274{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
3275{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
3276{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
3277{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
3278{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
3279{"glPointSize", "(F)V", (void *) android_glPointSize__F },
3280{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
3281{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
3282{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
3283{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
3284{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
3285{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
3286{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
3287{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
3288{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
3289{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
3290{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
3291{"glScalex", "(III)V", (void *) android_glScalex__III },
3292{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
3293{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
3294{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
3295{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
3296{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
3297{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
3298{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
3299{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
3300{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
3301{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
3302{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
3303{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
3304{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
3305{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
3306{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
3307{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3308{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
3309{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
3310{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
3311{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
3312};
3313
3314int register_android_opengl_jni_GLES10(JNIEnv *_env)
3315{
3316 int err;
3317 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
3318 return err;
3319}