blob: 3d9a3b6687b10b44a43ee73d6c8ecb6b86b588cb [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"
Andreas Gampebfe63332014-11-12 14:12:45 -080021#pragma GCC diagnostic ignored "-Wunused-function"
22
Mathias Agopian2ad04772013-02-23 03:12:30 -080023#include <GLES/gl.h>
24#include <GLES/glext.h>
25
Jesse Hall9626f822014-05-19 20:57:49 -070026#include <jni.h>
Steven Moreland2279b252017-07-19 09:50:45 -070027#include <nativehelper/JNIHelp.h>
Jack Palevich27f80022009-04-15 19:13:17 -070028#include <android_runtime/AndroidRuntime.h>
29#include <utils/misc.h>
Jack Palevich27f80022009-04-15 19:13:17 -070030#include <assert.h>
Mathias Agopian8331f722009-05-08 15:35:17 -070031
Mathias Agopian2ad04772013-02-23 03:12:30 -080032
33/* special calls implemented in Android's GLES wrapper used to more
34 * efficiently bound-check passed arrays */
35extern "C" {
36#ifdef GL_VERSION_ES_CM_1_1
37GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
38 const GLvoid *ptr, GLsizei count);
39GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
40 const GLvoid *pointer, GLsizei count);
41GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
42 GLsizei stride, const GLvoid *pointer, GLsizei count);
43GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
44 GLsizei stride, const GLvoid *pointer, GLsizei count);
45GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
46 GLsizei stride, const GLvoid *pointer, GLsizei count);
47GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
48 GLsizei stride, const GLvoid *pointer, GLsizei count);
49GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
50 GLsizei stride, const GLvoid *pointer, GLsizei count);
51#endif
52#ifdef GL_ES_VERSION_2_0
53static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
54 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
55 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
56}
57#endif
Andy McFaddencee51982013-04-25 16:08:31 -070058#ifdef GL_ES_VERSION_3_0
59static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
60 GLsizei stride, const GLvoid *pointer, GLsizei count) {
61 glVertexAttribIPointer(indx, size, type, stride, pointer);
62}
63#endif
Mathias Agopian2ad04772013-02-23 03:12:30 -080064}
65
Jack Palevich27f80022009-04-15 19:13:17 -070066static void
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070067nativeClassInit(JNIEnv *_env, jclass glImplClass)
Jack Palevich27f80022009-04-15 19:13:17 -070068{
Jack Palevich27f80022009-04-15 19:13:17 -070069}
70
Jack Palevich27f80022009-04-15 19:13:17 -070071static void *
Thomas Tafertshofer17045a12012-07-12 13:55:55 -070072getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
Jack Palevich27f80022009-04-15 19:13:17 -070073{
74 jint position;
75 jint limit;
76 jint elementSizeShift;
77 jlong pointer;
Jack Palevich27f80022009-04-15 19:13:17 -070078
Orion Hodson02440d32019-02-28 15:15:34 +000079 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
Jack Palevich27f80022009-04-15 19:13:17 -070080 *remaining = (limit - position) << elementSizeShift;
Jack Palevich27f80022009-04-15 19:13:17 -070081 if (pointer != 0L) {
Orion Hodson02440d32019-02-28 15:15:34 +000082 *array = nullptr;
83 pointer += position << elementSizeShift;
Ashok Bhat01c26ea2014-02-24 09:49:07 +000084 return reinterpret_cast<void*>(pointer);
Jack Palevich27f80022009-04-15 19:13:17 -070085 }
Elliott Hughes24ce5fb2011-04-08 20:01:01 -070086
Orion Hodson02440d32019-02-28 15:15:34 +000087 *array = jniGetNioBufferBaseArray(_env, buffer);
88 *offset = jniGetNioBufferBaseArrayOffset(_env, buffer);
89 return nullptr;
Jack Palevich27f80022009-04-15 19:13:17 -070090}
91
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -070092class ByteArrayGetter {
93public:
94 static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
95 return _env->GetByteArrayElements(array, is_copy);
96 }
97};
98class BooleanArrayGetter {
99public:
100 static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
101 return _env->GetBooleanArrayElements(array, is_copy);
102 }
103};
104class CharArrayGetter {
105public:
106 static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
107 return _env->GetCharArrayElements(array, is_copy);
108 }
109};
110class ShortArrayGetter {
111public:
112 static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
113 return _env->GetShortArrayElements(array, is_copy);
114 }
115};
116class IntArrayGetter {
117public:
118 static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
119 return _env->GetIntArrayElements(array, is_copy);
120 }
121};
122class LongArrayGetter {
123public:
124 static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
125 return _env->GetLongArrayElements(array, is_copy);
126 }
127};
128class FloatArrayGetter {
129public:
130 static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
131 return _env->GetFloatArrayElements(array, is_copy);
132 }
133};
134class DoubleArrayGetter {
135public:
136 static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
137 return _env->GetDoubleArrayElements(array, is_copy);
138 }
139};
140
141template<typename JTYPEARRAY, typename ARRAYGETTER>
142static void*
143getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
144 return ARRAYGETTER::Get(_env, array, is_copy);
145}
146
147class ByteArrayReleaser {
148public:
149 static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
150 _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
151 }
152};
153class BooleanArrayReleaser {
154public:
155 static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
156 _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
157 }
158};
159class CharArrayReleaser {
160public:
161 static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
162 _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
163 }
164};
165class ShortArrayReleaser {
166public:
167 static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
168 _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
169 }
170};
171class IntArrayReleaser {
172public:
173 static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
174 _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
175 }
176};
177class LongArrayReleaser {
178public:
179 static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
180 _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
181 }
182};
183class FloatArrayReleaser {
184public:
185 static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
186 _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
187 }
188};
189class DoubleArrayReleaser {
190public:
191 static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
192 _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
193 }
194};
195
196template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
197static void
198releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
199 ARRAYRELEASER::Release(_env, array, data, commit);
200}
201
Jack Palevich27f80022009-04-15 19:13:17 -0700202static void
203releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
204{
205 _env->ReleasePrimitiveArrayCritical(array, data,
Mathias Agopian2ad04772013-02-23 03:12:30 -0800206 commit ? 0 : JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -0700207}
208
Jack Palevich16e79722009-05-15 18:13:34 -0700209static void *
210getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
Orion Hodson02440d32019-02-28 15:15:34 +0000211 jint position;
212 jint limit;
213 jint elementSizeShift;
214 jlong pointer;
215 pointer = jniGetNioBufferFields(_env, buffer, &position, &limit, &elementSizeShift);
216 if (pointer == 0) {
Elliott Hughes24ce5fb2011-04-08 20:01:01 -0700217 jniThrowException(_env, "java/lang/IllegalArgumentException",
218 "Must use a native order direct Buffer");
Orion Hodson02440d32019-02-28 15:15:34 +0000219 return nullptr;
Jack Palevich16e79722009-05-15 18:13:34 -0700220 }
Orion Hodson02440d32019-02-28 15:15:34 +0000221 pointer += position << elementSizeShift;
222 return reinterpret_cast<void*>(pointer);
Jack Palevich16e79722009-05-15 18:13:34 -0700223}
224
Mathias Agopian2ad04772013-02-23 03:12:30 -0800225// --------------------------------------------------------------------------
226
227/*
228 * returns the number of values glGet returns for a given pname.
229 *
230 * The code below is written such that pnames requiring only one values
231 * are the default (and are not explicitely tested for). This makes the
232 * checking code much shorter/readable/efficient.
233 *
234 * This means that unknown pnames (e.g.: extensions) will default to 1. If
235 * that unknown pname needs more than 1 value, then the validation check
236 * is incomplete and the app may crash if it passed the wrong number params.
237 */
238static int getNeededCount(GLint pname) {
239 int needed = 1;
Romain Guydc43a6c2017-02-17 19:54:25 -0800240#ifdef GL_ES_VERSION_3_0
241 // GLES 3.x pnames
242 switch (pname) {
243 case GL_MAX_VIEWPORT_DIMS:
244 needed = 2;
245 break;
246
247 case GL_PROGRAM_BINARY_FORMATS:
248 glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &needed);
249 break;
250 }
251#endif
252
Mathias Agopian2ad04772013-02-23 03:12:30 -0800253#ifdef GL_ES_VERSION_2_0
254 // GLES 2.x pnames
255 switch (pname) {
256 case GL_ALIASED_LINE_WIDTH_RANGE:
257 case GL_ALIASED_POINT_SIZE_RANGE:
258 needed = 2;
259 break;
260
261 case GL_BLEND_COLOR:
262 case GL_COLOR_CLEAR_VALUE:
263 case GL_COLOR_WRITEMASK:
264 case GL_SCISSOR_BOX:
265 case GL_VIEWPORT:
266 needed = 4;
267 break;
268
269 case GL_COMPRESSED_TEXTURE_FORMATS:
270 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
271 break;
272
273 case GL_SHADER_BINARY_FORMATS:
274 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
275 break;
276 }
277#endif
278
279#ifdef GL_VERSION_ES_CM_1_1
280 // GLES 1.x pnames
281 switch (pname) {
282 case GL_ALIASED_LINE_WIDTH_RANGE:
283 case GL_ALIASED_POINT_SIZE_RANGE:
284 case GL_DEPTH_RANGE:
285 case GL_SMOOTH_LINE_WIDTH_RANGE:
286 case GL_SMOOTH_POINT_SIZE_RANGE:
287 needed = 2;
288 break;
289
290 case GL_CURRENT_NORMAL:
291 case GL_POINT_DISTANCE_ATTENUATION:
292 needed = 3;
293 break;
294
295 case GL_COLOR_CLEAR_VALUE:
296 case GL_COLOR_WRITEMASK:
297 case GL_CURRENT_COLOR:
298 case GL_CURRENT_TEXTURE_COORDS:
299 case GL_FOG_COLOR:
300 case GL_LIGHT_MODEL_AMBIENT:
301 case GL_SCISSOR_BOX:
302 case GL_VIEWPORT:
303 needed = 4;
304 break;
305
306 case GL_MODELVIEW_MATRIX:
307 case GL_PROJECTION_MATRIX:
308 case GL_TEXTURE_MATRIX:
309 needed = 16;
310 break;
311
312 case GL_COMPRESSED_TEXTURE_FORMATS:
313 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
314 break;
315 }
316#endif
317 return needed;
318}
319
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700320template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
321 typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
Mathias Agopian2ad04772013-02-23 03:12:30 -0800322static void
323get
324 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
325 jint _exception = 0;
326 const char * _exceptionType;
327 const char * _exceptionMessage;
328 CTYPE *params_base = (CTYPE *) 0;
329 jint _remaining;
330 CTYPE *params = (CTYPE *) 0;
331 int _needed = 0;
332
333 if (!params_ref) {
334 _exception = 1;
335 _exceptionType = "java/lang/IllegalArgumentException";
336 _exceptionMessage = "params == null";
337 goto exit;
338 }
339 if (offset < 0) {
340 _exception = 1;
341 _exceptionType = "java/lang/IllegalArgumentException";
342 _exceptionMessage = "offset < 0";
343 goto exit;
344 }
345 _remaining = _env->GetArrayLength(params_ref) - offset;
346 _needed = getNeededCount(pname);
347 // if we didn't find this pname, we just assume the user passed
348 // an array of the right size -- this might happen with extensions
349 // or if we forget an enum here.
350 if (_remaining < _needed) {
351 _exception = 1;
352 _exceptionType = "java/lang/IllegalArgumentException";
353 _exceptionMessage = "length - offset < needed";
354 goto exit;
355 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700356 params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
357 _env, params_ref, (jboolean *)0);
Mathias Agopian2ad04772013-02-23 03:12:30 -0800358 params = params_base + offset;
359
360 GET(
361 (GLenum)pname,
362 (CTYPE *)params
363 );
364
365exit:
366 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700367 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
368 _env, params_ref, params_base, !_exception);
Mathias Agopian2ad04772013-02-23 03:12:30 -0800369 }
370 if (_exception) {
371 jniThrowException(_env, _exceptionType, _exceptionMessage);
372 }
373}
374
375
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700376template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
377 typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
Mathias Agopian2ad04772013-02-23 03:12:30 -0800378static void
379getarray
380 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
381 jint _exception = 0;
382 const char * _exceptionType;
383 const char * _exceptionMessage;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700384 JTYPEARRAY _array = (JTYPEARRAY) 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800385 jint _bufferOffset = (jint) 0;
386 jint _remaining;
387 CTYPE *params = (CTYPE *) 0;
388 int _needed = 0;
389
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700390 params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Andy McFaddencee51982013-04-25 16:08:31 -0700391 _remaining /= sizeof(CTYPE); // convert from bytes to item count
Mathias Agopian2ad04772013-02-23 03:12:30 -0800392 _needed = getNeededCount(pname);
393 // if we didn't find this pname, we just assume the user passed
394 // an array of the right size -- this might happen with extensions
395 // or if we forget an enum here.
396 if (_needed>0 && _remaining < _needed) {
397 _exception = 1;
398 _exceptionType = "java/lang/IllegalArgumentException";
399 _exceptionMessage = "remaining() < needed";
400 goto exit;
401 }
402 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700403 char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
404 _env, _array, (jboolean *) 0);
Mathias Agopian2ad04772013-02-23 03:12:30 -0800405 params = (CTYPE *) (_paramsBase + _bufferOffset);
406 }
407 GET(
408 (GLenum)pname,
409 (CTYPE *)params
410 );
411
412exit:
413 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700414 releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
415 _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
Mathias Agopian2ad04772013-02-23 03:12:30 -0800416 }
417 if (_exception) {
418 jniThrowException(_env, _exceptionType, _exceptionMessage);
419 }
Jack Palevichbe509c92009-05-07 09:52:14 -0700420}
421
Jack Palevich27f80022009-04-15 19:13:17 -0700422// --------------------------------------------------------------------------
Jack Palevich27f80022009-04-15 19:13:17 -0700423/* void glActiveTexture ( GLenum texture ) */
424static void
425android_glActiveTexture__I
426 (JNIEnv *_env, jobject _this, jint texture) {
427 glActiveTexture(
428 (GLenum)texture
429 );
430}
431
432/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
433static void
434android_glAlphaFunc__IF
435 (JNIEnv *_env, jobject _this, jint func, jfloat ref) {
436 glAlphaFunc(
437 (GLenum)func,
438 (GLclampf)ref
439 );
440}
441
442/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
443static void
444android_glAlphaFuncx__II
445 (JNIEnv *_env, jobject _this, jint func, jint ref) {
446 glAlphaFuncx(
447 (GLenum)func,
448 (GLclampx)ref
449 );
450}
451
452/* void glBindTexture ( GLenum target, GLuint texture ) */
453static void
454android_glBindTexture__II
455 (JNIEnv *_env, jobject _this, jint target, jint texture) {
456 glBindTexture(
457 (GLenum)target,
458 (GLuint)texture
459 );
460}
461
462/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
463static void
464android_glBlendFunc__II
465 (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
466 glBlendFunc(
467 (GLenum)sfactor,
468 (GLenum)dfactor
469 );
470}
471
472/* void glClear ( GLbitfield mask ) */
473static void
474android_glClear__I
475 (JNIEnv *_env, jobject _this, jint mask) {
476 glClear(
477 (GLbitfield)mask
478 );
479}
480
481/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
482static void
483android_glClearColor__FFFF
484 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
485 glClearColor(
486 (GLclampf)red,
487 (GLclampf)green,
488 (GLclampf)blue,
489 (GLclampf)alpha
490 );
491}
492
493/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
494static void
495android_glClearColorx__IIII
496 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
497 glClearColorx(
498 (GLclampx)red,
499 (GLclampx)green,
500 (GLclampx)blue,
501 (GLclampx)alpha
502 );
503}
504
505/* void glClearDepthf ( GLclampf depth ) */
506static void
507android_glClearDepthf__F
508 (JNIEnv *_env, jobject _this, jfloat depth) {
509 glClearDepthf(
510 (GLclampf)depth
511 );
512}
513
514/* void glClearDepthx ( GLclampx depth ) */
515static void
516android_glClearDepthx__I
517 (JNIEnv *_env, jobject _this, jint depth) {
518 glClearDepthx(
519 (GLclampx)depth
520 );
521}
522
523/* void glClearStencil ( GLint s ) */
524static void
525android_glClearStencil__I
526 (JNIEnv *_env, jobject _this, jint s) {
527 glClearStencil(
528 (GLint)s
529 );
530}
531
532/* void glClientActiveTexture ( GLenum texture ) */
533static void
534android_glClientActiveTexture__I
535 (JNIEnv *_env, jobject _this, jint texture) {
536 glClientActiveTexture(
537 (GLenum)texture
538 );
539}
540
541/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
542static void
543android_glColor4f__FFFF
544 (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
545 glColor4f(
546 (GLfloat)red,
547 (GLfloat)green,
548 (GLfloat)blue,
549 (GLfloat)alpha
550 );
551}
552
553/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
554static void
555android_glColor4x__IIII
556 (JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
557 glColor4x(
558 (GLfixed)red,
559 (GLfixed)green,
560 (GLfixed)blue,
561 (GLfixed)alpha
562 );
563}
564
565/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
566static void
567android_glColorMask__ZZZZ
568 (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
569 glColorMask(
570 (GLboolean)red,
571 (GLboolean)green,
572 (GLboolean)blue,
573 (GLboolean)alpha
574 );
575}
576
577/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
578static void
579android_glColorPointerBounds__IIILjava_nio_Buffer_2I
580 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -0800581 jint _exception = 0;
582 const char * _exceptionType = NULL;
583 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700584 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700585 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700586 jint _remaining;
587 GLvoid *pointer = (GLvoid *) 0;
588
Jack Paleviche20ea782009-05-07 18:28:29 -0700589 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -0700590 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -0700591 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -0700592 return;
593 }
594 }
Jack Palevich27f80022009-04-15 19:13:17 -0700595 glColorPointerBounds(
596 (GLint)size,
597 (GLenum)type,
598 (GLsizei)stride,
599 (GLvoid *)pointer,
600 (GLsizei)remaining
601 );
Romain Guy84cac202016-12-05 12:26:02 -0800602 if (_exception) {
603 jniThrowException(_env, _exceptionType, _exceptionMessage);
604 }
Jack Palevich27f80022009-04-15 19:13:17 -0700605}
606
607/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
608static void
609android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
610 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800611 jint _exception = 0;
612 const char * _exceptionType = NULL;
613 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700614 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700615 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700616 jint _remaining;
617 GLvoid *data = (GLvoid *) 0;
618
Romain Guy84cac202016-12-05 12:26:02 -0800619 if (!data_buf) {
620 _exception = 1;
621 _exceptionType = "java/lang/IllegalArgumentException";
622 _exceptionMessage = "data == null";
623 goto exit;
624 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700625 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700626 if (data == NULL) {
627 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
628 data = (GLvoid *) (_dataBase + _bufferOffset);
629 }
Jack Palevich27f80022009-04-15 19:13:17 -0700630 glCompressedTexImage2D(
631 (GLenum)target,
632 (GLint)level,
633 (GLenum)internalformat,
634 (GLsizei)width,
635 (GLsizei)height,
636 (GLint)border,
637 (GLsizei)imageSize,
638 (GLvoid *)data
639 );
Romain Guy84cac202016-12-05 12:26:02 -0800640
641exit:
Jack Palevich27f80022009-04-15 19:13:17 -0700642 if (_array) {
643 releasePointer(_env, _array, data, JNI_FALSE);
644 }
Romain Guy84cac202016-12-05 12:26:02 -0800645 if (_exception) {
646 jniThrowException(_env, _exceptionType, _exceptionMessage);
647 }
Jack Palevich27f80022009-04-15 19:13:17 -0700648}
649
650/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
651static void
652android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
653 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
Romain Guy84cac202016-12-05 12:26:02 -0800654 jint _exception = 0;
655 const char * _exceptionType = NULL;
656 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700657 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700658 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700659 jint _remaining;
660 GLvoid *data = (GLvoid *) 0;
661
Romain Guy84cac202016-12-05 12:26:02 -0800662 if (!data_buf) {
663 _exception = 1;
664 _exceptionType = "java/lang/IllegalArgumentException";
665 _exceptionMessage = "data == null";
666 goto exit;
667 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700668 data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700669 if (data == NULL) {
670 char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
671 data = (GLvoid *) (_dataBase + _bufferOffset);
672 }
Jack Palevich27f80022009-04-15 19:13:17 -0700673 glCompressedTexSubImage2D(
674 (GLenum)target,
675 (GLint)level,
676 (GLint)xoffset,
677 (GLint)yoffset,
678 (GLsizei)width,
679 (GLsizei)height,
680 (GLenum)format,
681 (GLsizei)imageSize,
682 (GLvoid *)data
683 );
Romain Guy84cac202016-12-05 12:26:02 -0800684
685exit:
Jack Palevich27f80022009-04-15 19:13:17 -0700686 if (_array) {
687 releasePointer(_env, _array, data, JNI_FALSE);
688 }
Romain Guy84cac202016-12-05 12:26:02 -0800689 if (_exception) {
690 jniThrowException(_env, _exceptionType, _exceptionMessage);
691 }
Jack Palevich27f80022009-04-15 19:13:17 -0700692}
693
694/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
695static void
696android_glCopyTexImage2D__IIIIIIII
697 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
698 glCopyTexImage2D(
699 (GLenum)target,
700 (GLint)level,
701 (GLenum)internalformat,
702 (GLint)x,
703 (GLint)y,
704 (GLsizei)width,
705 (GLsizei)height,
706 (GLint)border
707 );
708}
709
710/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
711static void
712android_glCopyTexSubImage2D__IIIIIIII
713 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
714 glCopyTexSubImage2D(
715 (GLenum)target,
716 (GLint)level,
717 (GLint)xoffset,
718 (GLint)yoffset,
719 (GLint)x,
720 (GLint)y,
721 (GLsizei)width,
722 (GLsizei)height
723 );
724}
725
726/* void glCullFace ( GLenum mode ) */
727static void
728android_glCullFace__I
729 (JNIEnv *_env, jobject _this, jint mode) {
730 glCullFace(
731 (GLenum)mode
732 );
733}
734
735/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
736static void
737android_glDeleteTextures__I_3II
738 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700739 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800740 const char * _exceptionType = NULL;
741 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700742 GLuint *textures_base = (GLuint *) 0;
743 jint _remaining;
744 GLuint *textures = (GLuint *) 0;
745
746 if (!textures_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700747 _exception = 1;
748 _exceptionType = "java/lang/IllegalArgumentException";
749 _exceptionMessage = "textures == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700750 goto exit;
751 }
752 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700753 _exception = 1;
754 _exceptionType = "java/lang/IllegalArgumentException";
755 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -0700756 goto exit;
757 }
758 _remaining = _env->GetArrayLength(textures_ref) - offset;
759 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700760 _exception = 1;
761 _exceptionType = "java/lang/IllegalArgumentException";
762 _exceptionMessage = "length - offset < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700763 goto exit;
764 }
765 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700766 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -0700767 textures = textures_base + offset;
768
769 glDeleteTextures(
770 (GLsizei)n,
771 (GLuint *)textures
772 );
773
774exit:
775 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700776 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
Jack Palevich27f80022009-04-15 19:13:17 -0700777 JNI_ABORT);
778 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700779 if (_exception) {
780 jniThrowException(_env, _exceptionType, _exceptionMessage);
781 }
Jack Palevich27f80022009-04-15 19:13:17 -0700782}
783
784/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
785static void
786android_glDeleteTextures__ILjava_nio_IntBuffer_2
787 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700788 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800789 const char * _exceptionType = NULL;
790 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700791 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700792 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700793 jint _remaining;
794 GLuint *textures = (GLuint *) 0;
795
Romain Guy84cac202016-12-05 12:26:02 -0800796 if (!textures_buf) {
797 _exception = 1;
798 _exceptionType = "java/lang/IllegalArgumentException";
799 _exceptionMessage = "textures == null";
800 goto exit;
801 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700802 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700803 if (_remaining < n) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700804 _exception = 1;
805 _exceptionType = "java/lang/IllegalArgumentException";
806 _exceptionMessage = "remaining() < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700807 goto exit;
808 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700809 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700810 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700811 textures = (GLuint *) (_texturesBase + _bufferOffset);
812 }
Jack Palevich27f80022009-04-15 19:13:17 -0700813 glDeleteTextures(
814 (GLsizei)n,
815 (GLuint *)textures
816 );
817
818exit:
819 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700820 _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -0700821 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700822 if (_exception) {
823 jniThrowException(_env, _exceptionType, _exceptionMessage);
824 }
Jack Palevich27f80022009-04-15 19:13:17 -0700825}
826
827/* void glDepthFunc ( GLenum func ) */
828static void
829android_glDepthFunc__I
830 (JNIEnv *_env, jobject _this, jint func) {
831 glDepthFunc(
832 (GLenum)func
833 );
834}
835
836/* void glDepthMask ( GLboolean flag ) */
837static void
838android_glDepthMask__Z
839 (JNIEnv *_env, jobject _this, jboolean flag) {
840 glDepthMask(
841 (GLboolean)flag
842 );
843}
844
845/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
846static void
847android_glDepthRangef__FF
848 (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
849 glDepthRangef(
850 (GLclampf)zNear,
851 (GLclampf)zFar
852 );
853}
854
855/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
856static void
857android_glDepthRangex__II
858 (JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
859 glDepthRangex(
860 (GLclampx)zNear,
861 (GLclampx)zFar
862 );
863}
864
865/* void glDisable ( GLenum cap ) */
866static void
867android_glDisable__I
868 (JNIEnv *_env, jobject _this, jint cap) {
869 glDisable(
870 (GLenum)cap
871 );
872}
873
874/* void glDisableClientState ( GLenum array ) */
875static void
876android_glDisableClientState__I
877 (JNIEnv *_env, jobject _this, jint array) {
878 glDisableClientState(
879 (GLenum)array
880 );
881}
882
883/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
884static void
885android_glDrawArrays__III
886 (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
887 glDrawArrays(
888 (GLenum)mode,
889 (GLint)first,
890 (GLsizei)count
891 );
892}
893
894/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
895static void
896android_glDrawElements__IIILjava_nio_Buffer_2
897 (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700898 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800899 const char * _exceptionType = NULL;
900 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700901 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700902 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -0700903 jint _remaining;
904 GLvoid *indices = (GLvoid *) 0;
905
Romain Guy84cac202016-12-05 12:26:02 -0800906 if (!indices_buf) {
907 _exception = 1;
908 _exceptionType = "java/lang/IllegalArgumentException";
909 _exceptionMessage = "indices == null";
910 goto exit;
911 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -0700912 indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -0700913 if (_remaining < count) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700914 _exception = 1;
915 _exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
916 _exceptionMessage = "remaining() < count < needed";
Jack Palevich27f80022009-04-15 19:13:17 -0700917 goto exit;
918 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -0700919 if (indices == NULL) {
920 char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
921 indices = (GLvoid *) (_indicesBase + _bufferOffset);
922 }
Jack Palevich27f80022009-04-15 19:13:17 -0700923 glDrawElements(
924 (GLenum)mode,
925 (GLsizei)count,
926 (GLenum)type,
927 (GLvoid *)indices
928 );
929
930exit:
931 if (_array) {
932 releasePointer(_env, _array, indices, JNI_FALSE);
933 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700934 if (_exception) {
935 jniThrowException(_env, _exceptionType, _exceptionMessage);
936 }
Jack Palevich27f80022009-04-15 19:13:17 -0700937}
938
939/* void glEnable ( GLenum cap ) */
940static void
941android_glEnable__I
942 (JNIEnv *_env, jobject _this, jint cap) {
943 glEnable(
944 (GLenum)cap
945 );
946}
947
948/* void glEnableClientState ( GLenum array ) */
949static void
950android_glEnableClientState__I
951 (JNIEnv *_env, jobject _this, jint array) {
952 glEnableClientState(
953 (GLenum)array
954 );
955}
956
957/* void glFinish ( void ) */
958static void
959android_glFinish__
960 (JNIEnv *_env, jobject _this) {
961 glFinish();
962}
963
964/* void glFlush ( void ) */
965static void
966android_glFlush__
967 (JNIEnv *_env, jobject _this) {
968 glFlush();
969}
970
971/* void glFogf ( GLenum pname, GLfloat param ) */
972static void
973android_glFogf__IF
974 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
975 glFogf(
976 (GLenum)pname,
977 (GLfloat)param
978 );
979}
980
981/* void glFogfv ( GLenum pname, const GLfloat *params ) */
982static void
983android_glFogfv__I_3FI
984 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700985 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -0800986 const char * _exceptionType = NULL;
987 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -0700988 GLfloat *params_base = (GLfloat *) 0;
989 jint _remaining;
990 GLfloat *params = (GLfloat *) 0;
991
992 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700993 _exception = 1;
994 _exceptionType = "java/lang/IllegalArgumentException";
995 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -0700996 goto exit;
997 }
998 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -0700999 _exception = 1;
1000 _exceptionType = "java/lang/IllegalArgumentException";
1001 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001002 goto exit;
1003 }
1004 _remaining = _env->GetArrayLength(params_ref) - offset;
1005 int _needed;
1006 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001007#if defined(GL_FOG_COLOR)
1008 case GL_FOG_COLOR:
1009#endif // defined(GL_FOG_COLOR)
1010 _needed = 4;
1011 break;
1012 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001013 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001014 break;
1015 }
1016 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001017 _exception = 1;
1018 _exceptionType = "java/lang/IllegalArgumentException";
1019 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001020 goto exit;
1021 }
1022 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001023 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001024 params = params_base + offset;
1025
1026 glFogfv(
1027 (GLenum)pname,
1028 (GLfloat *)params
1029 );
1030
1031exit:
1032 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001033 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001034 JNI_ABORT);
1035 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001036 if (_exception) {
1037 jniThrowException(_env, _exceptionType, _exceptionMessage);
1038 }
Jack Palevich27f80022009-04-15 19:13:17 -07001039}
1040
1041/* void glFogfv ( GLenum pname, const GLfloat *params ) */
1042static void
1043android_glFogfv__ILjava_nio_FloatBuffer_2
1044 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001045 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001046 const char * _exceptionType = NULL;
1047 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001048 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001049 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001050 jint _remaining;
1051 GLfloat *params = (GLfloat *) 0;
1052
Romain Guy84cac202016-12-05 12:26:02 -08001053 if (!params_buf) {
1054 _exception = 1;
1055 _exceptionType = "java/lang/IllegalArgumentException";
1056 _exceptionMessage = "params == null";
1057 goto exit;
1058 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001059 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001060 int _needed;
1061 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001062#if defined(GL_FOG_COLOR)
1063 case GL_FOG_COLOR:
1064#endif // defined(GL_FOG_COLOR)
1065 _needed = 4;
1066 break;
1067 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001068 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001069 break;
1070 }
1071 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001072 _exception = 1;
1073 _exceptionType = "java/lang/IllegalArgumentException";
1074 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001075 goto exit;
1076 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001077 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001078 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001079 params = (GLfloat *) (_paramsBase + _bufferOffset);
1080 }
Jack Palevich27f80022009-04-15 19:13:17 -07001081 glFogfv(
1082 (GLenum)pname,
1083 (GLfloat *)params
1084 );
1085
1086exit:
1087 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001088 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001089 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001090 if (_exception) {
1091 jniThrowException(_env, _exceptionType, _exceptionMessage);
1092 }
Jack Palevich27f80022009-04-15 19:13:17 -07001093}
1094
1095/* void glFogx ( GLenum pname, GLfixed param ) */
1096static void
1097android_glFogx__II
1098 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1099 glFogx(
1100 (GLenum)pname,
1101 (GLfixed)param
1102 );
1103}
1104
1105/* void glFogxv ( GLenum pname, const GLfixed *params ) */
1106static void
1107android_glFogxv__I_3II
1108 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001109 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001110 const char * _exceptionType = NULL;
1111 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001112 GLfixed *params_base = (GLfixed *) 0;
1113 jint _remaining;
1114 GLfixed *params = (GLfixed *) 0;
1115
1116 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001117 _exception = 1;
1118 _exceptionType = "java/lang/IllegalArgumentException";
1119 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001120 goto exit;
1121 }
1122 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001123 _exception = 1;
1124 _exceptionType = "java/lang/IllegalArgumentException";
1125 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001126 goto exit;
1127 }
1128 _remaining = _env->GetArrayLength(params_ref) - offset;
1129 int _needed;
1130 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001131#if defined(GL_FOG_COLOR)
1132 case GL_FOG_COLOR:
1133#endif // defined(GL_FOG_COLOR)
1134 _needed = 4;
1135 break;
1136 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001137 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001138 break;
1139 }
1140 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001141 _exception = 1;
1142 _exceptionType = "java/lang/IllegalArgumentException";
1143 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001144 goto exit;
1145 }
1146 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001147 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001148 params = params_base + offset;
1149
1150 glFogxv(
1151 (GLenum)pname,
1152 (GLfixed *)params
1153 );
1154
1155exit:
1156 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001157 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001158 JNI_ABORT);
1159 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001160 if (_exception) {
1161 jniThrowException(_env, _exceptionType, _exceptionMessage);
1162 }
Jack Palevich27f80022009-04-15 19:13:17 -07001163}
1164
1165/* void glFogxv ( GLenum pname, const GLfixed *params ) */
1166static void
1167android_glFogxv__ILjava_nio_IntBuffer_2
1168 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001169 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001170 const char * _exceptionType = NULL;
1171 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001172 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001173 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001174 jint _remaining;
1175 GLfixed *params = (GLfixed *) 0;
1176
Romain Guy84cac202016-12-05 12:26:02 -08001177 if (!params_buf) {
1178 _exception = 1;
1179 _exceptionType = "java/lang/IllegalArgumentException";
1180 _exceptionMessage = "params == null";
1181 goto exit;
1182 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001183 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001184 int _needed;
1185 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001186#if defined(GL_FOG_COLOR)
1187 case GL_FOG_COLOR:
1188#endif // defined(GL_FOG_COLOR)
1189 _needed = 4;
1190 break;
1191 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001192 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001193 break;
1194 }
1195 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001196 _exception = 1;
1197 _exceptionType = "java/lang/IllegalArgumentException";
1198 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001199 goto exit;
1200 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001201 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001202 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001203 params = (GLfixed *) (_paramsBase + _bufferOffset);
1204 }
Jack Palevich27f80022009-04-15 19:13:17 -07001205 glFogxv(
1206 (GLenum)pname,
1207 (GLfixed *)params
1208 );
1209
1210exit:
1211 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001212 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001213 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001214 if (_exception) {
1215 jniThrowException(_env, _exceptionType, _exceptionMessage);
1216 }
Jack Palevich27f80022009-04-15 19:13:17 -07001217}
1218
1219/* void glFrontFace ( GLenum mode ) */
1220static void
1221android_glFrontFace__I
1222 (JNIEnv *_env, jobject _this, jint mode) {
1223 glFrontFace(
1224 (GLenum)mode
1225 );
1226}
1227
1228/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
1229static void
1230android_glFrustumf__FFFFFF
1231 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
1232 glFrustumf(
1233 (GLfloat)left,
1234 (GLfloat)right,
1235 (GLfloat)bottom,
1236 (GLfloat)top,
1237 (GLfloat)zNear,
1238 (GLfloat)zFar
1239 );
1240}
1241
1242/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
1243static void
1244android_glFrustumx__IIIIII
1245 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
1246 glFrustumx(
1247 (GLfixed)left,
1248 (GLfixed)right,
1249 (GLfixed)bottom,
1250 (GLfixed)top,
1251 (GLfixed)zNear,
1252 (GLfixed)zFar
1253 );
1254}
1255
1256/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1257static void
1258android_glGenTextures__I_3II
1259 (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
1260 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001261 const char * _exceptionType = NULL;
1262 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001263 GLuint *textures_base = (GLuint *) 0;
1264 jint _remaining;
1265 GLuint *textures = (GLuint *) 0;
1266
1267 if (!textures_ref) {
1268 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001269 _exceptionType = "java/lang/IllegalArgumentException";
1270 _exceptionMessage = "textures == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001271 goto exit;
1272 }
1273 if (offset < 0) {
1274 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001275 _exceptionType = "java/lang/IllegalArgumentException";
1276 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001277 goto exit;
1278 }
1279 _remaining = _env->GetArrayLength(textures_ref) - offset;
1280 if (_remaining < n) {
1281 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001282 _exceptionType = "java/lang/IllegalArgumentException";
1283 _exceptionMessage = "length - offset < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001284 goto exit;
1285 }
1286 textures_base = (GLuint *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001287 _env->GetIntArrayElements(textures_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001288 textures = textures_base + offset;
1289
1290 glGenTextures(
1291 (GLsizei)n,
1292 (GLuint *)textures
1293 );
1294
1295exit:
1296 if (textures_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001297 _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001298 _exception ? JNI_ABORT: 0);
1299 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001300 if (_exception) {
1301 jniThrowException(_env, _exceptionType, _exceptionMessage);
1302 }
Jack Palevich27f80022009-04-15 19:13:17 -07001303}
1304
1305/* void glGenTextures ( GLsizei n, GLuint *textures ) */
1306static void
1307android_glGenTextures__ILjava_nio_IntBuffer_2
1308 (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
1309 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001310 const char * _exceptionType = NULL;
1311 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001312 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001313 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001314 jint _remaining;
1315 GLuint *textures = (GLuint *) 0;
1316
Romain Guy84cac202016-12-05 12:26:02 -08001317 if (!textures_buf) {
1318 _exception = 1;
1319 _exceptionType = "java/lang/IllegalArgumentException";
1320 _exceptionMessage = "textures == null";
1321 goto exit;
1322 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001323 textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001324 if (_remaining < n) {
1325 _exception = 1;
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001326 _exceptionType = "java/lang/IllegalArgumentException";
1327 _exceptionMessage = "remaining() < n < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001328 goto exit;
1329 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001330 if (textures == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001331 char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001332 textures = (GLuint *) (_texturesBase + _bufferOffset);
1333 }
Jack Palevich27f80022009-04-15 19:13:17 -07001334 glGenTextures(
1335 (GLsizei)n,
1336 (GLuint *)textures
1337 );
1338
1339exit:
1340 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001341 _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0);
Jack Palevich27f80022009-04-15 19:13:17 -07001342 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001343 if (_exception) {
1344 jniThrowException(_env, _exceptionType, _exceptionMessage);
1345 }
Jack Palevich27f80022009-04-15 19:13:17 -07001346}
1347
1348/* GLenum glGetError ( void ) */
1349static jint
1350android_glGetError__
1351 (JNIEnv *_env, jobject _this) {
1352 GLenum _returnValue;
1353 _returnValue = glGetError();
Andy McFaddencee51982013-04-25 16:08:31 -07001354 return (jint)_returnValue;
Jack Palevich27f80022009-04-15 19:13:17 -07001355}
1356
1357/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1358static void
1359android_glGetIntegerv__I_3II
1360 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001361 get<jintArray, IntArrayGetter, jint*, IntArrayReleaser, GLint, glGetIntegerv>(
1362 _env, _this, pname, params_ref, offset);
Jack Palevich27f80022009-04-15 19:13:17 -07001363}
1364
1365/* void glGetIntegerv ( GLenum pname, GLint *params ) */
1366static void
1367android_glGetIntegerv__ILjava_nio_IntBuffer_2
1368 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001369 getarray<GLint, jintArray, IntArrayGetter, jint*, IntArrayReleaser, glGetIntegerv>(
1370 _env, _this, pname, params_buf);
Jack Palevich27f80022009-04-15 19:13:17 -07001371}
Jack Palevich27f80022009-04-15 19:13:17 -07001372/* const GLubyte * glGetString ( GLenum name ) */
Elliott Hughes24ce5fb2011-04-08 20:01:01 -07001373static jstring android_glGetString(JNIEnv* _env, jobject, jint name) {
1374 const char* chars = (const char*) glGetString((GLenum) name);
1375 return _env->NewStringUTF(chars);
Jack Palevich27f80022009-04-15 19:13:17 -07001376}
1377/* void glHint ( GLenum target, GLenum mode ) */
1378static void
1379android_glHint__II
1380 (JNIEnv *_env, jobject _this, jint target, jint mode) {
1381 glHint(
1382 (GLenum)target,
1383 (GLenum)mode
1384 );
1385}
1386
1387/* void glLightModelf ( GLenum pname, GLfloat param ) */
1388static void
1389android_glLightModelf__IF
1390 (JNIEnv *_env, jobject _this, jint pname, jfloat param) {
1391 glLightModelf(
1392 (GLenum)pname,
1393 (GLfloat)param
1394 );
1395}
1396
1397/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1398static void
1399android_glLightModelfv__I_3FI
1400 (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001401 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001402 const char * _exceptionType = NULL;
1403 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001404 GLfloat *params_base = (GLfloat *) 0;
1405 jint _remaining;
1406 GLfloat *params = (GLfloat *) 0;
1407
1408 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001409 _exception = 1;
1410 _exceptionType = "java/lang/IllegalArgumentException";
1411 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001412 goto exit;
1413 }
1414 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001415 _exception = 1;
1416 _exceptionType = "java/lang/IllegalArgumentException";
1417 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001418 goto exit;
1419 }
1420 _remaining = _env->GetArrayLength(params_ref) - offset;
1421 int _needed;
1422 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001423#if defined(GL_LIGHT_MODEL_AMBIENT)
1424 case GL_LIGHT_MODEL_AMBIENT:
1425#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1426 _needed = 4;
1427 break;
1428 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001429 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001430 break;
1431 }
1432 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001433 _exception = 1;
1434 _exceptionType = "java/lang/IllegalArgumentException";
1435 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001436 goto exit;
1437 }
1438 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001439 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001440 params = params_base + offset;
1441
1442 glLightModelfv(
1443 (GLenum)pname,
1444 (GLfloat *)params
1445 );
1446
1447exit:
1448 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001449 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001450 JNI_ABORT);
1451 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001452 if (_exception) {
1453 jniThrowException(_env, _exceptionType, _exceptionMessage);
1454 }
Jack Palevich27f80022009-04-15 19:13:17 -07001455}
1456
1457/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
1458static void
1459android_glLightModelfv__ILjava_nio_FloatBuffer_2
1460 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001461 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001462 const char * _exceptionType = NULL;
1463 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001464 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001465 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001466 jint _remaining;
1467 GLfloat *params = (GLfloat *) 0;
1468
Romain Guy84cac202016-12-05 12:26:02 -08001469 if (!params_buf) {
1470 _exception = 1;
1471 _exceptionType = "java/lang/IllegalArgumentException";
1472 _exceptionMessage = "params == null";
1473 goto exit;
1474 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001475 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001476 int _needed;
1477 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001478#if defined(GL_LIGHT_MODEL_AMBIENT)
1479 case GL_LIGHT_MODEL_AMBIENT:
1480#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1481 _needed = 4;
1482 break;
1483 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001484 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001485 break;
1486 }
1487 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001488 _exception = 1;
1489 _exceptionType = "java/lang/IllegalArgumentException";
1490 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001491 goto exit;
1492 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001493 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001494 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001495 params = (GLfloat *) (_paramsBase + _bufferOffset);
1496 }
Jack Palevich27f80022009-04-15 19:13:17 -07001497 glLightModelfv(
1498 (GLenum)pname,
1499 (GLfloat *)params
1500 );
1501
1502exit:
1503 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001504 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001505 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001506 if (_exception) {
1507 jniThrowException(_env, _exceptionType, _exceptionMessage);
1508 }
Jack Palevich27f80022009-04-15 19:13:17 -07001509}
1510
1511/* void glLightModelx ( GLenum pname, GLfixed param ) */
1512static void
1513android_glLightModelx__II
1514 (JNIEnv *_env, jobject _this, jint pname, jint param) {
1515 glLightModelx(
1516 (GLenum)pname,
1517 (GLfixed)param
1518 );
1519}
1520
1521/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
1522static void
1523android_glLightModelxv__I_3II
1524 (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001525 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001526 const char * _exceptionType = NULL;
1527 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001528 GLfixed *params_base = (GLfixed *) 0;
1529 jint _remaining;
1530 GLfixed *params = (GLfixed *) 0;
1531
1532 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001533 _exception = 1;
1534 _exceptionType = "java/lang/IllegalArgumentException";
1535 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001536 goto exit;
1537 }
1538 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001539 _exception = 1;
1540 _exceptionType = "java/lang/IllegalArgumentException";
1541 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001542 goto exit;
1543 }
1544 _remaining = _env->GetArrayLength(params_ref) - offset;
1545 int _needed;
1546 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001547#if defined(GL_LIGHT_MODEL_AMBIENT)
1548 case GL_LIGHT_MODEL_AMBIENT:
1549#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1550 _needed = 4;
1551 break;
1552 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001553 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001554 break;
1555 }
1556 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001557 _exception = 1;
1558 _exceptionType = "java/lang/IllegalArgumentException";
1559 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001560 goto exit;
1561 }
1562 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001563 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001564 params = params_base + offset;
1565
1566 glLightModelxv(
1567 (GLenum)pname,
1568 (GLfixed *)params
1569 );
1570
1571exit:
1572 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001573 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001574 JNI_ABORT);
1575 }
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 glLightModelxv ( GLenum pname, const GLfixed *params ) */
1582static void
1583android_glLightModelxv__ILjava_nio_IntBuffer_2
1584 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001585 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001586 const char * _exceptionType = NULL;
1587 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001588 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001589 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001590 jint _remaining;
1591 GLfixed *params = (GLfixed *) 0;
1592
Romain Guy84cac202016-12-05 12:26:02 -08001593 if (!params_buf) {
1594 _exception = 1;
1595 _exceptionType = "java/lang/IllegalArgumentException";
1596 _exceptionMessage = "params == null";
1597 goto exit;
1598 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001599 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001600 int _needed;
1601 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001602#if defined(GL_LIGHT_MODEL_AMBIENT)
1603 case GL_LIGHT_MODEL_AMBIENT:
1604#endif // defined(GL_LIGHT_MODEL_AMBIENT)
1605 _needed = 4;
1606 break;
1607 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001608 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001609 break;
1610 }
1611 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001612 _exception = 1;
1613 _exceptionType = "java/lang/IllegalArgumentException";
1614 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001615 goto exit;
1616 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001617 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001618 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001619 params = (GLfixed *) (_paramsBase + _bufferOffset);
1620 }
Jack Palevich27f80022009-04-15 19:13:17 -07001621 glLightModelxv(
1622 (GLenum)pname,
1623 (GLfixed *)params
1624 );
1625
1626exit:
1627 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001628 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001629 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001630 if (_exception) {
1631 jniThrowException(_env, _exceptionType, _exceptionMessage);
1632 }
Jack Palevich27f80022009-04-15 19:13:17 -07001633}
1634
1635/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
1636static void
1637android_glLightf__IIF
1638 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
1639 glLightf(
1640 (GLenum)light,
1641 (GLenum)pname,
1642 (GLfloat)param
1643 );
1644}
1645
1646/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1647static void
1648android_glLightfv__II_3FI
1649 (JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001650 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001651 const char * _exceptionType = NULL;
1652 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001653 GLfloat *params_base = (GLfloat *) 0;
1654 jint _remaining;
1655 GLfloat *params = (GLfloat *) 0;
1656
1657 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001658 _exception = 1;
1659 _exceptionType = "java/lang/IllegalArgumentException";
1660 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001661 goto exit;
1662 }
1663 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001664 _exception = 1;
1665 _exceptionType = "java/lang/IllegalArgumentException";
1666 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001667 goto exit;
1668 }
1669 _remaining = _env->GetArrayLength(params_ref) - offset;
1670 int _needed;
1671 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001672#if defined(GL_SPOT_DIRECTION)
1673 case GL_SPOT_DIRECTION:
1674#endif // defined(GL_SPOT_DIRECTION)
1675 _needed = 3;
1676 break;
1677#if defined(GL_AMBIENT)
1678 case GL_AMBIENT:
1679#endif // defined(GL_AMBIENT)
1680#if defined(GL_DIFFUSE)
1681 case GL_DIFFUSE:
1682#endif // defined(GL_DIFFUSE)
1683#if defined(GL_SPECULAR)
1684 case GL_SPECULAR:
1685#endif // defined(GL_SPECULAR)
1686#if defined(GL_EMISSION)
1687 case GL_EMISSION:
1688#endif // defined(GL_EMISSION)
1689 _needed = 4;
1690 break;
1691 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001692 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001693 break;
1694 }
1695 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001696 _exception = 1;
1697 _exceptionType = "java/lang/IllegalArgumentException";
1698 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001699 goto exit;
1700 }
1701 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001702 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001703 params = params_base + offset;
1704
1705 glLightfv(
1706 (GLenum)light,
1707 (GLenum)pname,
1708 (GLfloat *)params
1709 );
1710
1711exit:
1712 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001713 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001714 JNI_ABORT);
1715 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001716 if (_exception) {
1717 jniThrowException(_env, _exceptionType, _exceptionMessage);
1718 }
Jack Palevich27f80022009-04-15 19:13:17 -07001719}
1720
1721/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
1722static void
1723android_glLightfv__IILjava_nio_FloatBuffer_2
1724 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001725 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001726 const char * _exceptionType = NULL;
1727 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001728 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001729 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001730 jint _remaining;
1731 GLfloat *params = (GLfloat *) 0;
1732
Romain Guy84cac202016-12-05 12:26:02 -08001733 if (!params_buf) {
1734 _exception = 1;
1735 _exceptionType = "java/lang/IllegalArgumentException";
1736 _exceptionMessage = "params == null";
1737 goto exit;
1738 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001739 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001740 int _needed;
1741 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001742#if defined(GL_SPOT_DIRECTION)
1743 case GL_SPOT_DIRECTION:
1744#endif // defined(GL_SPOT_DIRECTION)
1745 _needed = 3;
1746 break;
1747#if defined(GL_AMBIENT)
1748 case GL_AMBIENT:
1749#endif // defined(GL_AMBIENT)
1750#if defined(GL_DIFFUSE)
1751 case GL_DIFFUSE:
1752#endif // defined(GL_DIFFUSE)
1753#if defined(GL_SPECULAR)
1754 case GL_SPECULAR:
1755#endif // defined(GL_SPECULAR)
1756#if defined(GL_EMISSION)
1757 case GL_EMISSION:
1758#endif // defined(GL_EMISSION)
1759 _needed = 4;
1760 break;
1761 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001762 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001763 break;
1764 }
1765 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001766 _exception = 1;
1767 _exceptionType = "java/lang/IllegalArgumentException";
1768 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001769 goto exit;
1770 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001771 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001772 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001773 params = (GLfloat *) (_paramsBase + _bufferOffset);
1774 }
Jack Palevich27f80022009-04-15 19:13:17 -07001775 glLightfv(
1776 (GLenum)light,
1777 (GLenum)pname,
1778 (GLfloat *)params
1779 );
1780
1781exit:
1782 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001783 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001784 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001785 if (_exception) {
1786 jniThrowException(_env, _exceptionType, _exceptionMessage);
1787 }
Jack Palevich27f80022009-04-15 19:13:17 -07001788}
1789
1790/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
1791static void
1792android_glLightx__III
1793 (JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
1794 glLightx(
1795 (GLenum)light,
1796 (GLenum)pname,
1797 (GLfixed)param
1798 );
1799}
1800
1801/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1802static void
1803android_glLightxv__II_3II
1804 (JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001805 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001806 const char * _exceptionType = NULL;
1807 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001808 GLfixed *params_base = (GLfixed *) 0;
1809 jint _remaining;
1810 GLfixed *params = (GLfixed *) 0;
1811
1812 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001813 _exception = 1;
1814 _exceptionType = "java/lang/IllegalArgumentException";
1815 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001816 goto exit;
1817 }
1818 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001819 _exception = 1;
1820 _exceptionType = "java/lang/IllegalArgumentException";
1821 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001822 goto exit;
1823 }
1824 _remaining = _env->GetArrayLength(params_ref) - offset;
1825 int _needed;
1826 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001827#if defined(GL_SPOT_DIRECTION)
1828 case GL_SPOT_DIRECTION:
1829#endif // defined(GL_SPOT_DIRECTION)
1830 _needed = 3;
1831 break;
1832#if defined(GL_AMBIENT)
1833 case GL_AMBIENT:
1834#endif // defined(GL_AMBIENT)
1835#if defined(GL_DIFFUSE)
1836 case GL_DIFFUSE:
1837#endif // defined(GL_DIFFUSE)
1838#if defined(GL_SPECULAR)
1839 case GL_SPECULAR:
1840#endif // defined(GL_SPECULAR)
1841#if defined(GL_EMISSION)
1842 case GL_EMISSION:
1843#endif // defined(GL_EMISSION)
1844 _needed = 4;
1845 break;
1846 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001847 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001848 break;
1849 }
1850 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001851 _exception = 1;
1852 _exceptionType = "java/lang/IllegalArgumentException";
1853 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001854 goto exit;
1855 }
1856 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001857 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001858 params = params_base + offset;
1859
1860 glLightxv(
1861 (GLenum)light,
1862 (GLenum)pname,
1863 (GLfixed *)params
1864 );
1865
1866exit:
1867 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001868 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07001869 JNI_ABORT);
1870 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001871 if (_exception) {
1872 jniThrowException(_env, _exceptionType, _exceptionMessage);
1873 }
Jack Palevich27f80022009-04-15 19:13:17 -07001874}
1875
1876/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
1877static void
1878android_glLightxv__IILjava_nio_IntBuffer_2
1879 (JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001880 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001881 const char * _exceptionType = NULL;
1882 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001883 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001884 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07001885 jint _remaining;
1886 GLfixed *params = (GLfixed *) 0;
1887
Romain Guy84cac202016-12-05 12:26:02 -08001888 if (!params_buf) {
1889 _exception = 1;
1890 _exceptionType = "java/lang/IllegalArgumentException";
1891 _exceptionMessage = "params == null";
1892 goto exit;
1893 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001894 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07001895 int _needed;
1896 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07001897#if defined(GL_SPOT_DIRECTION)
1898 case GL_SPOT_DIRECTION:
1899#endif // defined(GL_SPOT_DIRECTION)
1900 _needed = 3;
1901 break;
1902#if defined(GL_AMBIENT)
1903 case GL_AMBIENT:
1904#endif // defined(GL_AMBIENT)
1905#if defined(GL_DIFFUSE)
1906 case GL_DIFFUSE:
1907#endif // defined(GL_DIFFUSE)
1908#if defined(GL_SPECULAR)
1909 case GL_SPECULAR:
1910#endif // defined(GL_SPECULAR)
1911#if defined(GL_EMISSION)
1912 case GL_EMISSION:
1913#endif // defined(GL_EMISSION)
1914 _needed = 4;
1915 break;
1916 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08001917 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07001918 break;
1919 }
1920 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001921 _exception = 1;
1922 _exceptionType = "java/lang/IllegalArgumentException";
1923 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07001924 goto exit;
1925 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001926 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001927 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07001928 params = (GLfixed *) (_paramsBase + _bufferOffset);
1929 }
Jack Palevich27f80022009-04-15 19:13:17 -07001930 glLightxv(
1931 (GLenum)light,
1932 (GLenum)pname,
1933 (GLfixed *)params
1934 );
1935
1936exit:
1937 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001938 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07001939 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001940 if (_exception) {
1941 jniThrowException(_env, _exceptionType, _exceptionMessage);
1942 }
Jack Palevich27f80022009-04-15 19:13:17 -07001943}
1944
1945/* void glLineWidth ( GLfloat width ) */
1946static void
1947android_glLineWidth__F
1948 (JNIEnv *_env, jobject _this, jfloat width) {
1949 glLineWidth(
1950 (GLfloat)width
1951 );
1952}
1953
1954/* void glLineWidthx ( GLfixed width ) */
1955static void
1956android_glLineWidthx__I
1957 (JNIEnv *_env, jobject _this, jint width) {
1958 glLineWidthx(
1959 (GLfixed)width
1960 );
1961}
1962
1963/* void glLoadIdentity ( void ) */
1964static void
1965android_glLoadIdentity__
1966 (JNIEnv *_env, jobject _this) {
1967 glLoadIdentity();
1968}
1969
1970/* void glLoadMatrixf ( const GLfloat *m ) */
1971static void
1972android_glLoadMatrixf___3FI
1973 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001974 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08001975 const char * _exceptionType = NULL;
1976 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07001977 GLfloat *m_base = (GLfloat *) 0;
1978 jint _remaining;
1979 GLfloat *m = (GLfloat *) 0;
1980
1981 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001982 _exception = 1;
1983 _exceptionType = "java/lang/IllegalArgumentException";
1984 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07001985 goto exit;
1986 }
1987 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07001988 _exception = 1;
1989 _exceptionType = "java/lang/IllegalArgumentException";
1990 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07001991 goto exit;
1992 }
1993 _remaining = _env->GetArrayLength(m_ref) - offset;
1994 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07001995 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07001996 m = m_base + offset;
1997
1998 glLoadMatrixf(
1999 (GLfloat *)m
2000 );
2001
2002exit:
2003 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002004 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002005 JNI_ABORT);
2006 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002007 if (_exception) {
2008 jniThrowException(_env, _exceptionType, _exceptionMessage);
2009 }
Jack Palevich27f80022009-04-15 19:13:17 -07002010}
2011
2012/* void glLoadMatrixf ( const GLfloat *m ) */
2013static void
2014android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
2015 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002016 jint _exception = 0;
2017 const char * _exceptionType = NULL;
2018 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002019 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002020 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002021 jint _remaining;
2022 GLfloat *m = (GLfloat *) 0;
2023
Romain Guy84cac202016-12-05 12:26:02 -08002024 if (!m_buf) {
2025 _exception = 1;
2026 _exceptionType = "java/lang/IllegalArgumentException";
2027 _exceptionMessage = "m == null";
2028 goto exit;
2029 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002030 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002031 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002032 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002033 m = (GLfloat *) (_mBase + _bufferOffset);
2034 }
Jack Palevich27f80022009-04-15 19:13:17 -07002035 glLoadMatrixf(
2036 (GLfloat *)m
2037 );
Romain Guy84cac202016-12-05 12:26:02 -08002038
2039exit:
Jack Palevich27f80022009-04-15 19:13:17 -07002040 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002041 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002042 }
Romain Guy84cac202016-12-05 12:26:02 -08002043 if (_exception) {
2044 jniThrowException(_env, _exceptionType, _exceptionMessage);
2045 }
Jack Palevich27f80022009-04-15 19:13:17 -07002046}
2047
2048/* void glLoadMatrixx ( const GLfixed *m ) */
2049static void
2050android_glLoadMatrixx___3II
2051 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002052 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002053 const char * _exceptionType = NULL;
2054 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002055 GLfixed *m_base = (GLfixed *) 0;
2056 jint _remaining;
2057 GLfixed *m = (GLfixed *) 0;
2058
2059 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002060 _exception = 1;
2061 _exceptionType = "java/lang/IllegalArgumentException";
2062 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002063 goto exit;
2064 }
2065 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002066 _exception = 1;
2067 _exceptionType = "java/lang/IllegalArgumentException";
2068 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002069 goto exit;
2070 }
2071 _remaining = _env->GetArrayLength(m_ref) - offset;
2072 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002073 _env->GetIntArrayElements(m_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002074 m = m_base + offset;
2075
2076 glLoadMatrixx(
2077 (GLfixed *)m
2078 );
2079
2080exit:
2081 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002082 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002083 JNI_ABORT);
2084 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002085 if (_exception) {
2086 jniThrowException(_env, _exceptionType, _exceptionMessage);
2087 }
Jack Palevich27f80022009-04-15 19:13:17 -07002088}
2089
2090/* void glLoadMatrixx ( const GLfixed *m ) */
2091static void
2092android_glLoadMatrixx__Ljava_nio_IntBuffer_2
2093 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002094 jint _exception = 0;
2095 const char * _exceptionType = NULL;
2096 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002097 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002098 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002099 jint _remaining;
2100 GLfixed *m = (GLfixed *) 0;
2101
Romain Guy84cac202016-12-05 12:26:02 -08002102 if (!m_buf) {
2103 _exception = 1;
2104 _exceptionType = "java/lang/IllegalArgumentException";
2105 _exceptionMessage = "m == null";
2106 goto exit;
2107 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002108 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002109 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002110 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002111 m = (GLfixed *) (_mBase + _bufferOffset);
2112 }
Jack Palevich27f80022009-04-15 19:13:17 -07002113 glLoadMatrixx(
2114 (GLfixed *)m
2115 );
Romain Guy84cac202016-12-05 12:26:02 -08002116
2117exit:
Jack Palevich27f80022009-04-15 19:13:17 -07002118 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002119 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002120 }
Romain Guy84cac202016-12-05 12:26:02 -08002121 if (_exception) {
2122 jniThrowException(_env, _exceptionType, _exceptionMessage);
2123 }
Jack Palevich27f80022009-04-15 19:13:17 -07002124}
2125
2126/* void glLogicOp ( GLenum opcode ) */
2127static void
2128android_glLogicOp__I
2129 (JNIEnv *_env, jobject _this, jint opcode) {
2130 glLogicOp(
2131 (GLenum)opcode
2132 );
2133}
2134
2135/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
2136static void
2137android_glMaterialf__IIF
2138 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
2139 glMaterialf(
2140 (GLenum)face,
2141 (GLenum)pname,
2142 (GLfloat)param
2143 );
2144}
2145
2146/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2147static void
2148android_glMaterialfv__II_3FI
2149 (JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002150 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002151 const char * _exceptionType = NULL;
2152 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002153 GLfloat *params_base = (GLfloat *) 0;
2154 jint _remaining;
2155 GLfloat *params = (GLfloat *) 0;
2156
2157 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002158 _exception = 1;
2159 _exceptionType = "java/lang/IllegalArgumentException";
2160 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002161 goto exit;
2162 }
2163 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002164 _exception = 1;
2165 _exceptionType = "java/lang/IllegalArgumentException";
2166 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002167 goto exit;
2168 }
2169 _remaining = _env->GetArrayLength(params_ref) - offset;
2170 int _needed;
2171 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002172#if defined(GL_AMBIENT)
2173 case GL_AMBIENT:
2174#endif // defined(GL_AMBIENT)
2175#if defined(GL_DIFFUSE)
2176 case GL_DIFFUSE:
2177#endif // defined(GL_DIFFUSE)
2178#if defined(GL_SPECULAR)
2179 case GL_SPECULAR:
2180#endif // defined(GL_SPECULAR)
2181#if defined(GL_EMISSION)
2182 case GL_EMISSION:
2183#endif // defined(GL_EMISSION)
2184#if defined(GL_AMBIENT_AND_DIFFUSE)
2185 case GL_AMBIENT_AND_DIFFUSE:
2186#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2187 _needed = 4;
2188 break;
2189 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002190 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002191 break;
2192 }
2193 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002194 _exception = 1;
2195 _exceptionType = "java/lang/IllegalArgumentException";
2196 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002197 goto exit;
2198 }
2199 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002200 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002201 params = params_base + offset;
2202
2203 glMaterialfv(
2204 (GLenum)face,
2205 (GLenum)pname,
2206 (GLfloat *)params
2207 );
2208
2209exit:
2210 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002211 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002212 JNI_ABORT);
2213 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002214 if (_exception) {
2215 jniThrowException(_env, _exceptionType, _exceptionMessage);
2216 }
Jack Palevich27f80022009-04-15 19:13:17 -07002217}
2218
2219/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
2220static void
2221android_glMaterialfv__IILjava_nio_FloatBuffer_2
2222 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002223 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002224 const char * _exceptionType = NULL;
2225 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002226 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002227 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002228 jint _remaining;
2229 GLfloat *params = (GLfloat *) 0;
2230
Romain Guy84cac202016-12-05 12:26:02 -08002231 if (!params_buf) {
2232 _exception = 1;
2233 _exceptionType = "java/lang/IllegalArgumentException";
2234 _exceptionMessage = "params == null";
2235 goto exit;
2236 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002237 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002238 int _needed;
2239 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002240#if defined(GL_AMBIENT)
2241 case GL_AMBIENT:
2242#endif // defined(GL_AMBIENT)
2243#if defined(GL_DIFFUSE)
2244 case GL_DIFFUSE:
2245#endif // defined(GL_DIFFUSE)
2246#if defined(GL_SPECULAR)
2247 case GL_SPECULAR:
2248#endif // defined(GL_SPECULAR)
2249#if defined(GL_EMISSION)
2250 case GL_EMISSION:
2251#endif // defined(GL_EMISSION)
2252#if defined(GL_AMBIENT_AND_DIFFUSE)
2253 case GL_AMBIENT_AND_DIFFUSE:
2254#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2255 _needed = 4;
2256 break;
2257 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002258 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002259 break;
2260 }
2261 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002262 _exception = 1;
2263 _exceptionType = "java/lang/IllegalArgumentException";
2264 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002265 goto exit;
2266 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002267 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002268 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002269 params = (GLfloat *) (_paramsBase + _bufferOffset);
2270 }
Jack Palevich27f80022009-04-15 19:13:17 -07002271 glMaterialfv(
2272 (GLenum)face,
2273 (GLenum)pname,
2274 (GLfloat *)params
2275 );
2276
2277exit:
2278 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002279 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002280 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002281 if (_exception) {
2282 jniThrowException(_env, _exceptionType, _exceptionMessage);
2283 }
Jack Palevich27f80022009-04-15 19:13:17 -07002284}
2285
2286/* void glMaterialx ( GLenum face, GLenum pname, GLfixed param ) */
2287static void
2288android_glMaterialx__III
2289 (JNIEnv *_env, jobject _this, jint face, jint pname, jint param) {
2290 glMaterialx(
2291 (GLenum)face,
2292 (GLenum)pname,
2293 (GLfixed)param
2294 );
2295}
2296
2297/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2298static void
2299android_glMaterialxv__II_3II
2300 (JNIEnv *_env, jobject _this, jint face, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002301 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002302 const char * _exceptionType = NULL;
2303 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002304 GLfixed *params_base = (GLfixed *) 0;
2305 jint _remaining;
2306 GLfixed *params = (GLfixed *) 0;
2307
2308 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002309 _exception = 1;
2310 _exceptionType = "java/lang/IllegalArgumentException";
2311 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002312 goto exit;
2313 }
2314 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002315 _exception = 1;
2316 _exceptionType = "java/lang/IllegalArgumentException";
2317 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002318 goto exit;
2319 }
2320 _remaining = _env->GetArrayLength(params_ref) - offset;
2321 int _needed;
2322 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002323#if defined(GL_AMBIENT)
2324 case GL_AMBIENT:
2325#endif // defined(GL_AMBIENT)
2326#if defined(GL_DIFFUSE)
2327 case GL_DIFFUSE:
2328#endif // defined(GL_DIFFUSE)
2329#if defined(GL_SPECULAR)
2330 case GL_SPECULAR:
2331#endif // defined(GL_SPECULAR)
2332#if defined(GL_EMISSION)
2333 case GL_EMISSION:
2334#endif // defined(GL_EMISSION)
2335#if defined(GL_AMBIENT_AND_DIFFUSE)
2336 case GL_AMBIENT_AND_DIFFUSE:
2337#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2338 _needed = 4;
2339 break;
2340 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002341 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002342 break;
2343 }
2344 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002345 _exception = 1;
2346 _exceptionType = "java/lang/IllegalArgumentException";
2347 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002348 goto exit;
2349 }
2350 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002351 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002352 params = params_base + offset;
2353
2354 glMaterialxv(
2355 (GLenum)face,
2356 (GLenum)pname,
2357 (GLfixed *)params
2358 );
2359
2360exit:
2361 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002362 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002363 JNI_ABORT);
2364 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002365 if (_exception) {
2366 jniThrowException(_env, _exceptionType, _exceptionMessage);
2367 }
Jack Palevich27f80022009-04-15 19:13:17 -07002368}
2369
2370/* void glMaterialxv ( GLenum face, GLenum pname, const GLfixed *params ) */
2371static void
2372android_glMaterialxv__IILjava_nio_IntBuffer_2
2373 (JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002374 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002375 const char * _exceptionType = NULL;
2376 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002377 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002378 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002379 jint _remaining;
2380 GLfixed *params = (GLfixed *) 0;
2381
Romain Guy84cac202016-12-05 12:26:02 -08002382 if (!params_buf) {
2383 _exception = 1;
2384 _exceptionType = "java/lang/IllegalArgumentException";
2385 _exceptionMessage = "params == null";
2386 goto exit;
2387 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002388 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07002389 int _needed;
2390 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002391#if defined(GL_AMBIENT)
2392 case GL_AMBIENT:
2393#endif // defined(GL_AMBIENT)
2394#if defined(GL_DIFFUSE)
2395 case GL_DIFFUSE:
2396#endif // defined(GL_DIFFUSE)
2397#if defined(GL_SPECULAR)
2398 case GL_SPECULAR:
2399#endif // defined(GL_SPECULAR)
2400#if defined(GL_EMISSION)
2401 case GL_EMISSION:
2402#endif // defined(GL_EMISSION)
2403#if defined(GL_AMBIENT_AND_DIFFUSE)
2404 case GL_AMBIENT_AND_DIFFUSE:
2405#endif // defined(GL_AMBIENT_AND_DIFFUSE)
2406 _needed = 4;
2407 break;
2408 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08002409 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07002410 break;
2411 }
2412 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002413 _exception = 1;
2414 _exceptionType = "java/lang/IllegalArgumentException";
2415 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07002416 goto exit;
2417 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002418 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002419 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002420 params = (GLfixed *) (_paramsBase + _bufferOffset);
2421 }
Jack Palevich27f80022009-04-15 19:13:17 -07002422 glMaterialxv(
2423 (GLenum)face,
2424 (GLenum)pname,
2425 (GLfixed *)params
2426 );
2427
2428exit:
2429 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002430 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002431 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002432 if (_exception) {
2433 jniThrowException(_env, _exceptionType, _exceptionMessage);
2434 }
Jack Palevich27f80022009-04-15 19:13:17 -07002435}
2436
2437/* void glMatrixMode ( GLenum mode ) */
2438static void
2439android_glMatrixMode__I
2440 (JNIEnv *_env, jobject _this, jint mode) {
2441 glMatrixMode(
2442 (GLenum)mode
2443 );
2444}
2445
2446/* void glMultMatrixf ( const GLfloat *m ) */
2447static void
2448android_glMultMatrixf___3FI
2449 (JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002450 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002451 const char * _exceptionType = NULL;
2452 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002453 GLfloat *m_base = (GLfloat *) 0;
2454 jint _remaining;
2455 GLfloat *m = (GLfloat *) 0;
2456
2457 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002458 _exception = 1;
2459 _exceptionType = "java/lang/IllegalArgumentException";
2460 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002461 goto exit;
2462 }
2463 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002464 _exception = 1;
2465 _exceptionType = "java/lang/IllegalArgumentException";
2466 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002467 goto exit;
2468 }
2469 _remaining = _env->GetArrayLength(m_ref) - offset;
2470 m_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002471 _env->GetFloatArrayElements(m_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002472 m = m_base + offset;
2473
2474 glMultMatrixf(
2475 (GLfloat *)m
2476 );
2477
2478exit:
2479 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002480 _env->ReleaseFloatArrayElements(m_ref, (jfloat*)m_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002481 JNI_ABORT);
2482 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002483 if (_exception) {
2484 jniThrowException(_env, _exceptionType, _exceptionMessage);
2485 }
Jack Palevich27f80022009-04-15 19:13:17 -07002486}
2487
2488/* void glMultMatrixf ( const GLfloat *m ) */
2489static void
2490android_glMultMatrixf__Ljava_nio_FloatBuffer_2
2491 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002492 jint _exception = 0;
2493 const char * _exceptionType = NULL;
2494 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002495 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002496 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002497 jint _remaining;
2498 GLfloat *m = (GLfloat *) 0;
2499
Romain Guy84cac202016-12-05 12:26:02 -08002500 if (!m_buf) {
2501 _exception = 1;
2502 _exceptionType = "java/lang/IllegalArgumentException";
2503 _exceptionMessage = "m == null";
2504 goto exit;
2505 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002506 m = (GLfloat *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002507 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002508 char * _mBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002509 m = (GLfloat *) (_mBase + _bufferOffset);
2510 }
Jack Palevich27f80022009-04-15 19:13:17 -07002511 glMultMatrixf(
2512 (GLfloat *)m
2513 );
Romain Guy84cac202016-12-05 12:26:02 -08002514
2515exit:
Jack Palevich27f80022009-04-15 19:13:17 -07002516 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002517 _env->ReleaseFloatArrayElements(_array, (jfloat*)m, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002518 }
Romain Guy84cac202016-12-05 12:26:02 -08002519 if (_exception) {
2520 jniThrowException(_env, _exceptionType, _exceptionMessage);
2521 }
Jack Palevich27f80022009-04-15 19:13:17 -07002522}
2523
2524/* void glMultMatrixx ( const GLfixed *m ) */
2525static void
2526android_glMultMatrixx___3II
2527 (JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002528 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002529 const char * _exceptionType = NULL;
2530 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002531 GLfixed *m_base = (GLfixed *) 0;
2532 jint _remaining;
2533 GLfixed *m = (GLfixed *) 0;
2534
2535 if (!m_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002536 _exception = 1;
2537 _exceptionType = "java/lang/IllegalArgumentException";
2538 _exceptionMessage = "m == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002539 goto exit;
2540 }
2541 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002542 _exception = 1;
2543 _exceptionType = "java/lang/IllegalArgumentException";
2544 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002545 goto exit;
2546 }
2547 _remaining = _env->GetArrayLength(m_ref) - offset;
2548 m_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002549 _env->GetIntArrayElements(m_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07002550 m = m_base + offset;
2551
2552 glMultMatrixx(
2553 (GLfixed *)m
2554 );
2555
2556exit:
2557 if (m_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002558 _env->ReleaseIntArrayElements(m_ref, (jint*)m_base,
Jack Palevich27f80022009-04-15 19:13:17 -07002559 JNI_ABORT);
2560 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002561 if (_exception) {
2562 jniThrowException(_env, _exceptionType, _exceptionMessage);
2563 }
Jack Palevich27f80022009-04-15 19:13:17 -07002564}
2565
2566/* void glMultMatrixx ( const GLfixed *m ) */
2567static void
2568android_glMultMatrixx__Ljava_nio_IntBuffer_2
2569 (JNIEnv *_env, jobject _this, jobject m_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002570 jint _exception = 0;
2571 const char * _exceptionType = NULL;
2572 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002573 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002574 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002575 jint _remaining;
2576 GLfixed *m = (GLfixed *) 0;
2577
Romain Guy84cac202016-12-05 12:26:02 -08002578 if (!m_buf) {
2579 _exception = 1;
2580 _exceptionType = "java/lang/IllegalArgumentException";
2581 _exceptionMessage = "m == null";
2582 goto exit;
2583 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002584 m = (GLfixed *)getPointer(_env, m_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002585 if (m == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002586 char * _mBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002587 m = (GLfixed *) (_mBase + _bufferOffset);
2588 }
Jack Palevich27f80022009-04-15 19:13:17 -07002589 glMultMatrixx(
2590 (GLfixed *)m
2591 );
Romain Guy84cac202016-12-05 12:26:02 -08002592
2593exit:
Jack Palevich27f80022009-04-15 19:13:17 -07002594 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002595 _env->ReleaseIntArrayElements(_array, (jint*)m, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07002596 }
Romain Guy84cac202016-12-05 12:26:02 -08002597 if (_exception) {
2598 jniThrowException(_env, _exceptionType, _exceptionMessage);
2599 }
Jack Palevich27f80022009-04-15 19:13:17 -07002600}
2601
2602/* void glMultiTexCoord4f ( GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q ) */
2603static void
2604android_glMultiTexCoord4f__IFFFF
2605 (JNIEnv *_env, jobject _this, jint target, jfloat s, jfloat t, jfloat r, jfloat q) {
2606 glMultiTexCoord4f(
2607 (GLenum)target,
2608 (GLfloat)s,
2609 (GLfloat)t,
2610 (GLfloat)r,
2611 (GLfloat)q
2612 );
2613}
2614
2615/* void glMultiTexCoord4x ( GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q ) */
2616static void
2617android_glMultiTexCoord4x__IIIII
2618 (JNIEnv *_env, jobject _this, jint target, jint s, jint t, jint r, jint q) {
2619 glMultiTexCoord4x(
2620 (GLenum)target,
2621 (GLfixed)s,
2622 (GLfixed)t,
2623 (GLfixed)r,
2624 (GLfixed)q
2625 );
2626}
2627
2628/* void glNormal3f ( GLfloat nx, GLfloat ny, GLfloat nz ) */
2629static void
2630android_glNormal3f__FFF
2631 (JNIEnv *_env, jobject _this, jfloat nx, jfloat ny, jfloat nz) {
2632 glNormal3f(
2633 (GLfloat)nx,
2634 (GLfloat)ny,
2635 (GLfloat)nz
2636 );
2637}
2638
2639/* void glNormal3x ( GLfixed nx, GLfixed ny, GLfixed nz ) */
2640static void
2641android_glNormal3x__III
2642 (JNIEnv *_env, jobject _this, jint nx, jint ny, jint nz) {
2643 glNormal3x(
2644 (GLfixed)nx,
2645 (GLfixed)ny,
2646 (GLfixed)nz
2647 );
2648}
2649
2650/* void glNormalPointer ( GLenum type, GLsizei stride, const GLvoid *pointer ) */
2651static void
2652android_glNormalPointerBounds__IILjava_nio_Buffer_2I
2653 (JNIEnv *_env, jobject _this, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08002654 jint _exception = 0;
2655 const char * _exceptionType = NULL;
2656 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002657 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002658 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002659 jint _remaining;
2660 GLvoid *pointer = (GLvoid *) 0;
2661
Jack Paleviche20ea782009-05-07 18:28:29 -07002662 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07002663 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07002664 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07002665 return;
2666 }
2667 }
Jack Palevich27f80022009-04-15 19:13:17 -07002668 glNormalPointerBounds(
2669 (GLenum)type,
2670 (GLsizei)stride,
2671 (GLvoid *)pointer,
2672 (GLsizei)remaining
2673 );
Romain Guy84cac202016-12-05 12:26:02 -08002674 if (_exception) {
2675 jniThrowException(_env, _exceptionType, _exceptionMessage);
2676 }
Jack Palevich27f80022009-04-15 19:13:17 -07002677}
2678
2679/* void glOrthof ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
2680static void
2681android_glOrthof__FFFFFF
2682 (JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
2683 glOrthof(
2684 (GLfloat)left,
2685 (GLfloat)right,
2686 (GLfloat)bottom,
2687 (GLfloat)top,
2688 (GLfloat)zNear,
2689 (GLfloat)zFar
2690 );
2691}
2692
2693/* void glOrthox ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
2694static void
2695android_glOrthox__IIIIII
2696 (JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
2697 glOrthox(
2698 (GLfixed)left,
2699 (GLfixed)right,
2700 (GLfixed)bottom,
2701 (GLfixed)top,
2702 (GLfixed)zNear,
2703 (GLfixed)zFar
2704 );
2705}
2706
2707/* void glPixelStorei ( GLenum pname, GLint param ) */
2708static void
2709android_glPixelStorei__II
2710 (JNIEnv *_env, jobject _this, jint pname, jint param) {
2711 glPixelStorei(
2712 (GLenum)pname,
2713 (GLint)param
2714 );
2715}
2716
2717/* void glPointSize ( GLfloat size ) */
2718static void
2719android_glPointSize__F
2720 (JNIEnv *_env, jobject _this, jfloat size) {
2721 glPointSize(
2722 (GLfloat)size
2723 );
2724}
2725
2726/* void glPointSizex ( GLfixed size ) */
2727static void
2728android_glPointSizex__I
2729 (JNIEnv *_env, jobject _this, jint size) {
2730 glPointSizex(
2731 (GLfixed)size
2732 );
2733}
2734
2735/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */
2736static void
2737android_glPolygonOffset__FF
2738 (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) {
2739 glPolygonOffset(
2740 (GLfloat)factor,
2741 (GLfloat)units
2742 );
2743}
2744
2745/* void glPolygonOffsetx ( GLfixed factor, GLfixed units ) */
2746static void
2747android_glPolygonOffsetx__II
2748 (JNIEnv *_env, jobject _this, jint factor, jint units) {
2749 glPolygonOffsetx(
2750 (GLfixed)factor,
2751 (GLfixed)units
2752 );
2753}
2754
2755/* void glPopMatrix ( void ) */
2756static void
2757android_glPopMatrix__
2758 (JNIEnv *_env, jobject _this) {
2759 glPopMatrix();
2760}
2761
2762/* void glPushMatrix ( void ) */
2763static void
2764android_glPushMatrix__
2765 (JNIEnv *_env, jobject _this) {
2766 glPushMatrix();
2767}
2768
2769/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */
2770static void
2771android_glReadPixels__IIIIIILjava_nio_Buffer_2
2772 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08002773 jint _exception = 0;
2774 const char * _exceptionType = NULL;
2775 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002776 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002777 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002778 jint _remaining;
2779 GLvoid *pixels = (GLvoid *) 0;
2780
Romain Guy84cac202016-12-05 12:26:02 -08002781 if (!pixels_buf) {
2782 _exception = 1;
2783 _exceptionType = "java/lang/IllegalArgumentException";
2784 _exceptionMessage = "pixels == null";
2785 goto exit;
2786 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07002787 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002788 if (pixels == NULL) {
2789 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
2790 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
2791 }
Jack Palevich27f80022009-04-15 19:13:17 -07002792 glReadPixels(
2793 (GLint)x,
2794 (GLint)y,
2795 (GLsizei)width,
2796 (GLsizei)height,
2797 (GLenum)format,
2798 (GLenum)type,
2799 (GLvoid *)pixels
2800 );
Romain Guy84cac202016-12-05 12:26:02 -08002801
2802exit:
Jack Palevich27f80022009-04-15 19:13:17 -07002803 if (_array) {
Romain Guy84cac202016-12-05 12:26:02 -08002804 releasePointer(_env, _array, pixels, _exception ? JNI_FALSE : JNI_TRUE);
2805 }
2806 if (_exception) {
2807 jniThrowException(_env, _exceptionType, _exceptionMessage);
Jack Palevich27f80022009-04-15 19:13:17 -07002808 }
2809}
2810
2811/* void glRotatef ( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) */
2812static void
2813android_glRotatef__FFFF
2814 (JNIEnv *_env, jobject _this, jfloat angle, jfloat x, jfloat y, jfloat z) {
2815 glRotatef(
2816 (GLfloat)angle,
2817 (GLfloat)x,
2818 (GLfloat)y,
2819 (GLfloat)z
2820 );
2821}
2822
2823/* void glRotatex ( GLfixed angle, GLfixed x, GLfixed y, GLfixed z ) */
2824static void
2825android_glRotatex__IIII
2826 (JNIEnv *_env, jobject _this, jint angle, jint x, jint y, jint z) {
2827 glRotatex(
2828 (GLfixed)angle,
2829 (GLfixed)x,
2830 (GLfixed)y,
2831 (GLfixed)z
2832 );
2833}
2834
2835/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */
2836static void
2837android_glSampleCoverage__FZ
2838 (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) {
2839 glSampleCoverage(
2840 (GLclampf)value,
2841 (GLboolean)invert
2842 );
2843}
2844
2845/* void glSampleCoveragex ( GLclampx value, GLboolean invert ) */
2846static void
2847android_glSampleCoveragex__IZ
2848 (JNIEnv *_env, jobject _this, jint value, jboolean invert) {
2849 glSampleCoveragex(
2850 (GLclampx)value,
2851 (GLboolean)invert
2852 );
2853}
2854
2855/* void glScalef ( GLfloat x, GLfloat y, GLfloat z ) */
2856static void
2857android_glScalef__FFF
2858 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
2859 glScalef(
2860 (GLfloat)x,
2861 (GLfloat)y,
2862 (GLfloat)z
2863 );
2864}
2865
2866/* void glScalex ( GLfixed x, GLfixed y, GLfixed z ) */
2867static void
2868android_glScalex__III
2869 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
2870 glScalex(
2871 (GLfixed)x,
2872 (GLfixed)y,
2873 (GLfixed)z
2874 );
2875}
2876
2877/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */
2878static void
2879android_glScissor__IIII
2880 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
2881 glScissor(
2882 (GLint)x,
2883 (GLint)y,
2884 (GLsizei)width,
2885 (GLsizei)height
2886 );
2887}
2888
2889/* void glShadeModel ( GLenum mode ) */
2890static void
2891android_glShadeModel__I
2892 (JNIEnv *_env, jobject _this, jint mode) {
2893 glShadeModel(
2894 (GLenum)mode
2895 );
2896}
2897
2898/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */
2899static void
2900android_glStencilFunc__III
2901 (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) {
2902 glStencilFunc(
2903 (GLenum)func,
2904 (GLint)ref,
2905 (GLuint)mask
2906 );
2907}
2908
2909/* void glStencilMask ( GLuint mask ) */
2910static void
2911android_glStencilMask__I
2912 (JNIEnv *_env, jobject _this, jint mask) {
2913 glStencilMask(
2914 (GLuint)mask
2915 );
2916}
2917
2918/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */
2919static void
2920android_glStencilOp__III
2921 (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) {
2922 glStencilOp(
2923 (GLenum)fail,
2924 (GLenum)zfail,
2925 (GLenum)zpass
2926 );
2927}
2928
2929/* void glTexCoordPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
2930static void
2931android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I
2932 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08002933 jint _exception = 0;
2934 const char * _exceptionType = NULL;
2935 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002936 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07002937 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07002938 jint _remaining;
2939 GLvoid *pointer = (GLvoid *) 0;
2940
Jack Paleviche20ea782009-05-07 18:28:29 -07002941 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07002942 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07002943 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07002944 return;
2945 }
2946 }
Jack Palevich27f80022009-04-15 19:13:17 -07002947 glTexCoordPointerBounds(
2948 (GLint)size,
2949 (GLenum)type,
2950 (GLsizei)stride,
2951 (GLvoid *)pointer,
2952 (GLsizei)remaining
2953 );
Romain Guy84cac202016-12-05 12:26:02 -08002954 if (_exception) {
2955 jniThrowException(_env, _exceptionType, _exceptionMessage);
2956 }
Jack Palevich27f80022009-04-15 19:13:17 -07002957}
2958
2959/* void glTexEnvf ( GLenum target, GLenum pname, GLfloat param ) */
2960static void
2961android_glTexEnvf__IIF
2962 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
2963 glTexEnvf(
2964 (GLenum)target,
2965 (GLenum)pname,
2966 (GLfloat)param
2967 );
2968}
2969
2970/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
2971static void
2972android_glTexEnvfv__II_3FI
2973 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002974 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08002975 const char * _exceptionType = NULL;
2976 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07002977 GLfloat *params_base = (GLfloat *) 0;
2978 jint _remaining;
2979 GLfloat *params = (GLfloat *) 0;
2980
2981 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002982 _exception = 1;
2983 _exceptionType = "java/lang/IllegalArgumentException";
2984 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07002985 goto exit;
2986 }
2987 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07002988 _exception = 1;
2989 _exceptionType = "java/lang/IllegalArgumentException";
2990 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07002991 goto exit;
2992 }
2993 _remaining = _env->GetArrayLength(params_ref) - offset;
2994 int _needed;
2995 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07002996#if defined(GL_TEXTURE_ENV_COLOR)
2997 case GL_TEXTURE_ENV_COLOR:
2998#endif // defined(GL_TEXTURE_ENV_COLOR)
2999 _needed = 4;
3000 break;
3001 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003002 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07003003 break;
3004 }
3005 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003006 _exception = 1;
3007 _exceptionType = "java/lang/IllegalArgumentException";
3008 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07003009 goto exit;
3010 }
3011 params_base = (GLfloat *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003012 _env->GetFloatArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07003013 params = params_base + offset;
3014
3015 glTexEnvfv(
3016 (GLenum)target,
3017 (GLenum)pname,
3018 (GLfloat *)params
3019 );
3020
3021exit:
3022 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003023 _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07003024 JNI_ABORT);
3025 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003026 if (_exception) {
3027 jniThrowException(_env, _exceptionType, _exceptionMessage);
3028 }
Jack Palevich27f80022009-04-15 19:13:17 -07003029}
3030
3031/* void glTexEnvfv ( GLenum target, GLenum pname, const GLfloat *params ) */
3032static void
3033android_glTexEnvfv__IILjava_nio_FloatBuffer_2
3034 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003035 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003036 const char * _exceptionType = NULL;
3037 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003038 jfloatArray _array = (jfloatArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003039 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003040 jint _remaining;
3041 GLfloat *params = (GLfloat *) 0;
3042
Romain Guy84cac202016-12-05 12:26:02 -08003043 if (!params_buf) {
3044 _exception = 1;
3045 _exceptionType = "java/lang/IllegalArgumentException";
3046 _exceptionMessage = "params == null";
3047 goto exit;
3048 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003049 params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07003050 int _needed;
3051 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07003052#if defined(GL_TEXTURE_ENV_COLOR)
3053 case GL_TEXTURE_ENV_COLOR:
3054#endif // defined(GL_TEXTURE_ENV_COLOR)
3055 _needed = 4;
3056 break;
3057 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003058 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07003059 break;
3060 }
3061 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003062 _exception = 1;
3063 _exceptionType = "java/lang/IllegalArgumentException";
3064 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07003065 goto exit;
3066 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003067 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003068 char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003069 params = (GLfloat *) (_paramsBase + _bufferOffset);
3070 }
Jack Palevich27f80022009-04-15 19:13:17 -07003071 glTexEnvfv(
3072 (GLenum)target,
3073 (GLenum)pname,
3074 (GLfloat *)params
3075 );
3076
3077exit:
3078 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003079 _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07003080 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003081 if (_exception) {
3082 jniThrowException(_env, _exceptionType, _exceptionMessage);
3083 }
Jack Palevich27f80022009-04-15 19:13:17 -07003084}
3085
3086/* void glTexEnvx ( GLenum target, GLenum pname, GLfixed param ) */
3087static void
3088android_glTexEnvx__III
3089 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3090 glTexEnvx(
3091 (GLenum)target,
3092 (GLenum)pname,
3093 (GLfixed)param
3094 );
3095}
3096
3097/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3098static void
3099android_glTexEnvxv__II_3II
3100 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003101 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003102 const char * _exceptionType = NULL;
3103 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07003104 GLfixed *params_base = (GLfixed *) 0;
3105 jint _remaining;
3106 GLfixed *params = (GLfixed *) 0;
3107
3108 if (!params_ref) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003109 _exception = 1;
3110 _exceptionType = "java/lang/IllegalArgumentException";
3111 _exceptionMessage = "params == null";
Jack Palevich27f80022009-04-15 19:13:17 -07003112 goto exit;
3113 }
3114 if (offset < 0) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003115 _exception = 1;
3116 _exceptionType = "java/lang/IllegalArgumentException";
3117 _exceptionMessage = "offset < 0";
Jack Palevich27f80022009-04-15 19:13:17 -07003118 goto exit;
3119 }
3120 _remaining = _env->GetArrayLength(params_ref) - offset;
3121 int _needed;
3122 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07003123#if defined(GL_TEXTURE_ENV_COLOR)
3124 case GL_TEXTURE_ENV_COLOR:
3125#endif // defined(GL_TEXTURE_ENV_COLOR)
3126 _needed = 4;
3127 break;
3128 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003129 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07003130 break;
3131 }
3132 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003133 _exception = 1;
3134 _exceptionType = "java/lang/IllegalArgumentException";
3135 _exceptionMessage = "length - offset < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07003136 goto exit;
3137 }
3138 params_base = (GLfixed *)
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003139 _env->GetIntArrayElements(params_ref, (jboolean *)0);
Jack Palevich27f80022009-04-15 19:13:17 -07003140 params = params_base + offset;
3141
3142 glTexEnvxv(
3143 (GLenum)target,
3144 (GLenum)pname,
3145 (GLfixed *)params
3146 );
3147
3148exit:
3149 if (params_base) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003150 _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
Jack Palevich27f80022009-04-15 19:13:17 -07003151 JNI_ABORT);
3152 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003153 if (_exception) {
3154 jniThrowException(_env, _exceptionType, _exceptionMessage);
3155 }
Jack Palevich27f80022009-04-15 19:13:17 -07003156}
3157
3158/* void glTexEnvxv ( GLenum target, GLenum pname, const GLfixed *params ) */
3159static void
3160android_glTexEnvxv__IILjava_nio_IntBuffer_2
3161 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003162 jint _exception = 0;
Mathias Agopian2ad04772013-02-23 03:12:30 -08003163 const char * _exceptionType = NULL;
3164 const char * _exceptionMessage = NULL;
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003165 jintArray _array = (jintArray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003166 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003167 jint _remaining;
3168 GLfixed *params = (GLfixed *) 0;
3169
Romain Guy84cac202016-12-05 12:26:02 -08003170 if (!params_buf) {
3171 _exception = 1;
3172 _exceptionType = "java/lang/IllegalArgumentException";
3173 _exceptionMessage = "params == null";
3174 goto exit;
3175 }
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003176 params = (GLfixed *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07003177 int _needed;
3178 switch (pname) {
Jack Palevich27f80022009-04-15 19:13:17 -07003179#if defined(GL_TEXTURE_ENV_COLOR)
3180 case GL_TEXTURE_ENV_COLOR:
3181#endif // defined(GL_TEXTURE_ENV_COLOR)
3182 _needed = 4;
3183 break;
3184 default:
Mathias Agopian2ad04772013-02-23 03:12:30 -08003185 _needed = 1;
Jack Palevich27f80022009-04-15 19:13:17 -07003186 break;
3187 }
3188 if (_remaining < _needed) {
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003189 _exception = 1;
3190 _exceptionType = "java/lang/IllegalArgumentException";
3191 _exceptionMessage = "remaining() < needed";
Jack Palevich27f80022009-04-15 19:13:17 -07003192 goto exit;
3193 }
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003194 if (params == NULL) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003195 char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003196 params = (GLfixed *) (_paramsBase + _bufferOffset);
3197 }
Jack Palevich27f80022009-04-15 19:13:17 -07003198 glTexEnvxv(
3199 (GLenum)target,
3200 (GLenum)pname,
3201 (GLfixed *)params
3202 );
3203
3204exit:
3205 if (_array) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003206 _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT);
Jack Palevich27f80022009-04-15 19:13:17 -07003207 }
Thomas Tafertshofer2545b322012-06-27 16:33:26 -07003208 if (_exception) {
3209 jniThrowException(_env, _exceptionType, _exceptionMessage);
3210 }
Jack Palevich27f80022009-04-15 19:13:17 -07003211}
3212
3213/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
3214static void
3215android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2
3216 (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003217 jint _exception = 0;
3218 const char * _exceptionType = NULL;
3219 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07003220 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003221 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003222 jint _remaining;
3223 GLvoid *pixels = (GLvoid *) 0;
3224
3225 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003226 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003227 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07003228 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003229 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3230 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07003231 }
3232 glTexImage2D(
3233 (GLenum)target,
3234 (GLint)level,
3235 (GLint)internalformat,
3236 (GLsizei)width,
3237 (GLsizei)height,
3238 (GLint)border,
3239 (GLenum)format,
3240 (GLenum)type,
3241 (GLvoid *)pixels
3242 );
3243 if (_array) {
3244 releasePointer(_env, _array, pixels, JNI_FALSE);
3245 }
Romain Guy84cac202016-12-05 12:26:02 -08003246 if (_exception) {
3247 jniThrowException(_env, _exceptionType, _exceptionMessage);
3248 }
Jack Palevich27f80022009-04-15 19:13:17 -07003249}
3250
3251/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */
3252static void
3253android_glTexParameterf__IIF
3254 (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) {
3255 glTexParameterf(
3256 (GLenum)target,
3257 (GLenum)pname,
3258 (GLfloat)param
3259 );
3260}
3261
3262/* void glTexParameterx ( GLenum target, GLenum pname, GLfixed param ) */
3263static void
3264android_glTexParameterx__III
3265 (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
3266 glTexParameterx(
3267 (GLenum)target,
3268 (GLenum)pname,
3269 (GLfixed)param
3270 );
3271}
3272
3273/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */
3274static void
3275android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
3276 (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) {
Romain Guy84cac202016-12-05 12:26:02 -08003277 jint _exception = 0;
3278 const char * _exceptionType = NULL;
3279 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07003280 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003281 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003282 jint _remaining;
3283 GLvoid *pixels = (GLvoid *) 0;
3284
3285 if (pixels_buf) {
Hiroshi Yamauchi3b1d46e2015-05-13 13:10:33 -07003286 pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003287 }
Thomas Tafertshofer37c9b492012-07-23 16:56:04 -07003288 if (pixels_buf && pixels == NULL) {
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003289 char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
3290 pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
Jack Palevich27f80022009-04-15 19:13:17 -07003291 }
3292 glTexSubImage2D(
3293 (GLenum)target,
3294 (GLint)level,
3295 (GLint)xoffset,
3296 (GLint)yoffset,
3297 (GLsizei)width,
3298 (GLsizei)height,
3299 (GLenum)format,
3300 (GLenum)type,
3301 (GLvoid *)pixels
3302 );
3303 if (_array) {
3304 releasePointer(_env, _array, pixels, JNI_FALSE);
3305 }
Romain Guy84cac202016-12-05 12:26:02 -08003306 if (_exception) {
3307 jniThrowException(_env, _exceptionType, _exceptionMessage);
3308 }
Jack Palevich27f80022009-04-15 19:13:17 -07003309}
3310
3311/* void glTranslatef ( GLfloat x, GLfloat y, GLfloat z ) */
3312static void
3313android_glTranslatef__FFF
3314 (JNIEnv *_env, jobject _this, jfloat x, jfloat y, jfloat z) {
3315 glTranslatef(
3316 (GLfloat)x,
3317 (GLfloat)y,
3318 (GLfloat)z
3319 );
3320}
3321
3322/* void glTranslatex ( GLfixed x, GLfixed y, GLfixed z ) */
3323static void
3324android_glTranslatex__III
3325 (JNIEnv *_env, jobject _this, jint x, jint y, jint z) {
3326 glTranslatex(
3327 (GLfixed)x,
3328 (GLfixed)y,
3329 (GLfixed)z
3330 );
3331}
3332
3333/* void glVertexPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
3334static void
3335android_glVertexPointerBounds__IIILjava_nio_Buffer_2I
3336 (JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
Romain Guy84cac202016-12-05 12:26:02 -08003337 jint _exception = 0;
3338 const char * _exceptionType = NULL;
3339 const char * _exceptionMessage = NULL;
Jack Palevich27f80022009-04-15 19:13:17 -07003340 jarray _array = (jarray) 0;
Thomas Tafertshofer17045a12012-07-12 13:55:55 -07003341 jint _bufferOffset = (jint) 0;
Jack Palevich27f80022009-04-15 19:13:17 -07003342 jint _remaining;
3343 GLvoid *pointer = (GLvoid *) 0;
3344
Jack Paleviche20ea782009-05-07 18:28:29 -07003345 if (pointer_buf) {
Jack Palevich16e79722009-05-15 18:13:34 -07003346 pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
Jack Paleviche20ea782009-05-07 18:28:29 -07003347 if ( ! pointer ) {
Jack Paleviche20ea782009-05-07 18:28:29 -07003348 return;
3349 }
3350 }
Jack Palevich27f80022009-04-15 19:13:17 -07003351 glVertexPointerBounds(
3352 (GLint)size,
3353 (GLenum)type,
3354 (GLsizei)stride,
3355 (GLvoid *)pointer,
3356 (GLsizei)remaining
3357 );
Romain Guy84cac202016-12-05 12:26:02 -08003358 if (_exception) {
3359 jniThrowException(_env, _exceptionType, _exceptionMessage);
3360 }
Jack Palevich27f80022009-04-15 19:13:17 -07003361}
3362
3363/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */
3364static void
3365android_glViewport__IIII
3366 (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) {
3367 glViewport(
3368 (GLint)x,
3369 (GLint)y,
3370 (GLsizei)width,
3371 (GLsizei)height
3372 );
3373}
3374
3375static const char *classPathName = "android/opengl/GLES10";
3376
Daniel Micay76f6a862015-09-19 17:31:01 -04003377static const JNINativeMethod methods[] = {
Jack Palevich27f80022009-04-15 19:13:17 -07003378{"_nativeClassInit", "()V", (void*)nativeClassInit },
3379{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I },
3380{"glAlphaFunc", "(IF)V", (void *) android_glAlphaFunc__IF },
3381{"glAlphaFuncx", "(II)V", (void *) android_glAlphaFuncx__II },
3382{"glBindTexture", "(II)V", (void *) android_glBindTexture__II },
3383{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II },
3384{"glClear", "(I)V", (void *) android_glClear__I },
3385{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF },
3386{"glClearColorx", "(IIII)V", (void *) android_glClearColorx__IIII },
3387{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F },
3388{"glClearDepthx", "(I)V", (void *) android_glClearDepthx__I },
3389{"glClearStencil", "(I)V", (void *) android_glClearStencil__I },
3390{"glClientActiveTexture", "(I)V", (void *) android_glClientActiveTexture__I },
3391{"glColor4f", "(FFFF)V", (void *) android_glColor4f__FFFF },
3392{"glColor4x", "(IIII)V", (void *) android_glColor4x__IIII },
3393{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ },
3394{"glColorPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glColorPointerBounds__IIILjava_nio_Buffer_2I },
3395{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 },
3396{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3397{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII },
3398{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII },
3399{"glCullFace", "(I)V", (void *) android_glCullFace__I },
3400{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II },
3401{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 },
3402{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I },
3403{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z },
3404{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF },
3405{"glDepthRangex", "(II)V", (void *) android_glDepthRangex__II },
3406{"glDisable", "(I)V", (void *) android_glDisable__I },
3407{"glDisableClientState", "(I)V", (void *) android_glDisableClientState__I },
3408{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III },
3409{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 },
3410{"glEnable", "(I)V", (void *) android_glEnable__I },
3411{"glEnableClientState", "(I)V", (void *) android_glEnableClientState__I },
3412{"glFinish", "()V", (void *) android_glFinish__ },
3413{"glFlush", "()V", (void *) android_glFlush__ },
3414{"glFogf", "(IF)V", (void *) android_glFogf__IF },
3415{"glFogfv", "(I[FI)V", (void *) android_glFogfv__I_3FI },
3416{"glFogfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glFogfv__ILjava_nio_FloatBuffer_2 },
3417{"glFogx", "(II)V", (void *) android_glFogx__II },
3418{"glFogxv", "(I[II)V", (void *) android_glFogxv__I_3II },
3419{"glFogxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glFogxv__ILjava_nio_IntBuffer_2 },
3420{"glFrontFace", "(I)V", (void *) android_glFrontFace__I },
3421{"glFrustumf", "(FFFFFF)V", (void *) android_glFrustumf__FFFFFF },
3422{"glFrustumx", "(IIIIII)V", (void *) android_glFrustumx__IIIIII },
3423{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II },
3424{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 },
3425{"glGetError", "()I", (void *) android_glGetError__ },
3426{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II },
3427{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 },
Jack Palevicha3795852009-04-24 10:35:11 -07003428{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString },
Jack Palevich27f80022009-04-15 19:13:17 -07003429{"glHint", "(II)V", (void *) android_glHint__II },
3430{"glLightModelf", "(IF)V", (void *) android_glLightModelf__IF },
3431{"glLightModelfv", "(I[FI)V", (void *) android_glLightModelfv__I_3FI },
3432{"glLightModelfv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glLightModelfv__ILjava_nio_FloatBuffer_2 },
3433{"glLightModelx", "(II)V", (void *) android_glLightModelx__II },
3434{"glLightModelxv", "(I[II)V", (void *) android_glLightModelxv__I_3II },
3435{"glLightModelxv", "(ILjava/nio/IntBuffer;)V", (void *) android_glLightModelxv__ILjava_nio_IntBuffer_2 },
3436{"glLightf", "(IIF)V", (void *) android_glLightf__IIF },
3437{"glLightfv", "(II[FI)V", (void *) android_glLightfv__II_3FI },
3438{"glLightfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glLightfv__IILjava_nio_FloatBuffer_2 },
3439{"glLightx", "(III)V", (void *) android_glLightx__III },
3440{"glLightxv", "(II[II)V", (void *) android_glLightxv__II_3II },
3441{"glLightxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glLightxv__IILjava_nio_IntBuffer_2 },
3442{"glLineWidth", "(F)V", (void *) android_glLineWidth__F },
3443{"glLineWidthx", "(I)V", (void *) android_glLineWidthx__I },
3444{"glLoadIdentity", "()V", (void *) android_glLoadIdentity__ },
3445{"glLoadMatrixf", "([FI)V", (void *) android_glLoadMatrixf___3FI },
3446{"glLoadMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glLoadMatrixf__Ljava_nio_FloatBuffer_2 },
3447{"glLoadMatrixx", "([II)V", (void *) android_glLoadMatrixx___3II },
3448{"glLoadMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glLoadMatrixx__Ljava_nio_IntBuffer_2 },
3449{"glLogicOp", "(I)V", (void *) android_glLogicOp__I },
3450{"glMaterialf", "(IIF)V", (void *) android_glMaterialf__IIF },
3451{"glMaterialfv", "(II[FI)V", (void *) android_glMaterialfv__II_3FI },
3452{"glMaterialfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glMaterialfv__IILjava_nio_FloatBuffer_2 },
3453{"glMaterialx", "(III)V", (void *) android_glMaterialx__III },
3454{"glMaterialxv", "(II[II)V", (void *) android_glMaterialxv__II_3II },
3455{"glMaterialxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glMaterialxv__IILjava_nio_IntBuffer_2 },
3456{"glMatrixMode", "(I)V", (void *) android_glMatrixMode__I },
3457{"glMultMatrixf", "([FI)V", (void *) android_glMultMatrixf___3FI },
3458{"glMultMatrixf", "(Ljava/nio/FloatBuffer;)V", (void *) android_glMultMatrixf__Ljava_nio_FloatBuffer_2 },
3459{"glMultMatrixx", "([II)V", (void *) android_glMultMatrixx___3II },
3460{"glMultMatrixx", "(Ljava/nio/IntBuffer;)V", (void *) android_glMultMatrixx__Ljava_nio_IntBuffer_2 },
3461{"glMultiTexCoord4f", "(IFFFF)V", (void *) android_glMultiTexCoord4f__IFFFF },
3462{"glMultiTexCoord4x", "(IIIII)V", (void *) android_glMultiTexCoord4x__IIIII },
3463{"glNormal3f", "(FFF)V", (void *) android_glNormal3f__FFF },
3464{"glNormal3x", "(III)V", (void *) android_glNormal3x__III },
3465{"glNormalPointerBounds", "(IILjava/nio/Buffer;I)V", (void *) android_glNormalPointerBounds__IILjava_nio_Buffer_2I },
3466{"glOrthof", "(FFFFFF)V", (void *) android_glOrthof__FFFFFF },
3467{"glOrthox", "(IIIIII)V", (void *) android_glOrthox__IIIIII },
3468{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II },
3469{"glPointSize", "(F)V", (void *) android_glPointSize__F },
3470{"glPointSizex", "(I)V", (void *) android_glPointSizex__I },
3471{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF },
3472{"glPolygonOffsetx", "(II)V", (void *) android_glPolygonOffsetx__II },
3473{"glPopMatrix", "()V", (void *) android_glPopMatrix__ },
3474{"glPushMatrix", "()V", (void *) android_glPushMatrix__ },
3475{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 },
3476{"glRotatef", "(FFFF)V", (void *) android_glRotatef__FFFF },
3477{"glRotatex", "(IIII)V", (void *) android_glRotatex__IIII },
3478{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ },
3479{"glSampleCoveragex", "(IZ)V", (void *) android_glSampleCoveragex__IZ },
3480{"glScalef", "(FFF)V", (void *) android_glScalef__FFF },
3481{"glScalex", "(III)V", (void *) android_glScalex__III },
3482{"glScissor", "(IIII)V", (void *) android_glScissor__IIII },
3483{"glShadeModel", "(I)V", (void *) android_glShadeModel__I },
3484{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III },
3485{"glStencilMask", "(I)V", (void *) android_glStencilMask__I },
3486{"glStencilOp", "(III)V", (void *) android_glStencilOp__III },
3487{"glTexCoordPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glTexCoordPointerBounds__IIILjava_nio_Buffer_2I },
3488{"glTexEnvf", "(IIF)V", (void *) android_glTexEnvf__IIF },
3489{"glTexEnvfv", "(II[FI)V", (void *) android_glTexEnvfv__II_3FI },
3490{"glTexEnvfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexEnvfv__IILjava_nio_FloatBuffer_2 },
3491{"glTexEnvx", "(III)V", (void *) android_glTexEnvx__III },
3492{"glTexEnvxv", "(II[II)V", (void *) android_glTexEnvxv__II_3II },
3493{"glTexEnvxv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexEnvxv__IILjava_nio_IntBuffer_2 },
3494{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 },
3495{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF },
3496{"glTexParameterx", "(III)V", (void *) android_glTexParameterx__III },
3497{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 },
3498{"glTranslatef", "(FFF)V", (void *) android_glTranslatef__FFF },
3499{"glTranslatex", "(III)V", (void *) android_glTranslatex__III },
3500{"glVertexPointerBounds", "(IIILjava/nio/Buffer;I)V", (void *) android_glVertexPointerBounds__IIILjava_nio_Buffer_2I },
3501{"glViewport", "(IIII)V", (void *) android_glViewport__IIII },
3502};
3503
3504int register_android_opengl_jni_GLES10(JNIEnv *_env)
3505{
3506 int err;
3507 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
3508 return err;
3509}