blob: 7975987844de698c937c8284afc0279594d6b125 [file] [log] [blame]
/* //device/libs/android_runtime/com_google_android_gles_jni_GLImpl.cpp
**
** Copyright 2006, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
// This source file is automatically generated
#include "jni.h"
#include "JNIHelp.h"
#include <android_runtime/AndroidRuntime.h>
#include <utils/misc.h>
#include <assert.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
// Work around differences between the generated name and the actual name.
#define glBlendEquation glBlendEquationOES
#define glBlendEquationSeparate glBlendEquationSeparateOES
#define glBlendFuncSeparate glBlendFuncSeparateOES
#define glGetTexGenfv glGetTexGenfvOES
#define glGetTexGeniv glGetTexGenivOES
#define glGetTexGenxv glGetTexGenxvOES
#define glTexGenf glTexGenfOES
#define glTexGenfv glTexGenfvOES
#define glTexGeni glTexGeniOES
#define glTexGeniv glTexGenivOES
#define glTexGenx glTexGenxOES
#define glTexGenxv glTexGenxvOES
/* special calls implemented in Android's GLES wrapper used to more
* efficiently bound-check passed arrays */
extern "C" {
GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
const GLvoid *ptr, GLsizei count);
GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
GLsizei stride, const GLvoid *pointer, GLsizei count);
}
static int initialized = 0;
static jclass nioAccessClass;
static jclass bufferClass;
static jclass G11ImplClass;
static jmethodID getBasePointerID;
static jmethodID getBaseArrayID;
static jmethodID getBaseArrayOffsetID;
static jmethodID allowIndirectBuffersID;
static jfieldID positionID;
static jfieldID limitID;
static jfieldID elementSizeShiftID;
static jfieldID haveCheckedExtensionsID;
static jfieldID have_OES_blend_equation_separateID;
static jfieldID have_OES_blend_subtractID;
static jfieldID have_OES_framebuffer_objectID;
static jfieldID have_OES_texture_cube_mapID;
/* Cache method IDs each time the class is loaded. */
static void
nativeClassInit(JNIEnv *_env, jclass glImplClass)
{
jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
jclass g11impClassLocal = _env->FindClass("com/google/android/gles_jni/GLImpl");
G11ImplClass = (jclass) _env->NewGlobalRef(g11impClassLocal);
haveCheckedExtensionsID = _env->GetFieldID(G11ImplClass, "haveCheckedExtensions", "Z");
have_OES_blend_equation_separateID = _env->GetFieldID(G11ImplClass, "have_OES_blend_equation_separate", "Z");
have_OES_blend_subtractID = _env->GetFieldID(G11ImplClass, "have_OES_blend_subtract", "Z");
have_OES_framebuffer_objectID = _env->GetFieldID(G11ImplClass, "have_OES_framebuffer_object", "Z");
have_OES_texture_cube_mapID = _env->GetFieldID(G11ImplClass, "have_OES_texture_cube_map", "Z");
getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
"getBasePointer", "(Ljava/nio/Buffer;)J");
getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
"getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
allowIndirectBuffersID = _env->GetStaticMethodID(g11impClassLocal,
"allowIndirectBuffers", "(Ljava/lang/String;)Z");
positionID = _env->GetFieldID(bufferClass, "position", "I");
limitID = _env->GetFieldID(bufferClass, "limit", "I");
elementSizeShiftID =
_env->GetFieldID(bufferClass, "_elementSizeShift", "I");
}
static void *
getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
{
jint position;
jint limit;
jint elementSizeShift;
jlong pointer;
position = _env->GetIntField(buffer, positionID);
limit = _env->GetIntField(buffer, limitID);
elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
*remaining = (limit - position) << elementSizeShift;
pointer = _env->CallStaticLongMethod(nioAccessClass,
getBasePointerID, buffer);
if (pointer != 0L) {
*array = NULL;
return reinterpret_cast<void *>(pointer);
}
*array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
getBaseArrayID, buffer);
if (*array == NULL) {
return (void*) NULL;
}
*offset = _env->CallStaticIntMethod(nioAccessClass,
getBaseArrayOffsetID, buffer);
return NULL;
}
static void
releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
{
_env->ReleasePrimitiveArrayCritical(array, data,
commit ? 0 : JNI_ABORT);
}
extern "C" {
extern char* __progname;
}
static bool
allowIndirectBuffers(JNIEnv *_env) {
static jint sIndirectBufferCompatability;
if (sIndirectBufferCompatability == 0) {
jobject appName = _env->NewStringUTF(::__progname);
sIndirectBufferCompatability = _env->CallStaticBooleanMethod(G11ImplClass, allowIndirectBuffersID, appName) ? 2 : 1;
}
return sIndirectBufferCompatability == 2;
}
static void *
getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
if (!buffer) {
return NULL;
}
void* buf = _env->GetDirectBufferAddress(buffer);
if (buf) {
jint position = _env->GetIntField(buffer, positionID);
jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
buf = ((char*) buf) + (position << elementSizeShift);
} else {
if (allowIndirectBuffers(_env)) {
jarray array = 0;
jint remaining;
jint offset;
buf = getPointer(_env, buffer, &array, &remaining, &offset);
if (array) {
releasePointer(_env, array, buf, 0);
}
buf = (char*)buf + offset;
} else {
jniThrowException(_env, "java/lang/IllegalArgumentException",
"Must use a native order direct Buffer");
}
}
return buf;
}
static int
getNumCompressedTextureFormats() {
int numCompressedTextureFormats = 0;
glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &numCompressedTextureFormats);
return numCompressedTextureFormats;
}
// Check if the extension at the head of pExtensions is pExtension. Note that pExtensions is
// terminated by either 0 or space, while pExtension is terminated by 0.
static bool
extensionEqual(const GLubyte* pExtensions, const GLubyte* pExtension) {
while (true) {
char a = *pExtensions++;
char b = *pExtension++;
bool aEnd = a == '\0' || a == ' ';
bool bEnd = b == '\0';
if ( aEnd || bEnd) {
return aEnd == bEnd;
}
if ( a != b ) {
return false;
}
}
}
static const GLubyte*
nextExtension(const GLubyte* pExtensions) {
while (true) {
char a = *pExtensions++;
if ( a == '\0') {
return pExtensions-1;
} else if ( a == ' ') {
return pExtensions;
}
}
}
static bool
checkForExtension(const GLubyte* pExtensions, const GLubyte* pExtension) {
for (;*pExtensions != '\0'; pExtensions = nextExtension(pExtensions)) {
if (extensionEqual(pExtensions, pExtension)) {
return true;
}
}
return false;
}
static bool
supportsExtension(JNIEnv *_env, jobject impl, jfieldID fieldId) {
if (!_env->GetBooleanField(impl, haveCheckedExtensionsID)) {
_env->SetBooleanField(impl, haveCheckedExtensionsID, true);
const GLubyte* sExtensions = glGetString(GL_EXTENSIONS);
_env->SetBooleanField(impl, have_OES_blend_equation_separateID,
checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_equation_separate"));
_env->SetBooleanField(impl, have_OES_blend_subtractID,
checkForExtension(sExtensions, (const GLubyte*) "GL_OES_blend_subtract"));
_env->SetBooleanField(impl, have_OES_framebuffer_objectID,
checkForExtension(sExtensions, (const GLubyte*) "GL_OES_framebuffer_object"));
_env->SetBooleanField(impl, have_OES_texture_cube_mapID,
checkForExtension(sExtensions, (const GLubyte*) "GL_OES_texture_cube_map"));
}
return _env->GetBooleanField(impl, fieldId);
}
// --------------------------------------------------------------------------
/* void glActiveTexture ( GLenum texture ) */
static void
android_glActiveTexture__I
(JNIEnv *_env, jobject _this, jint texture) {
glActiveTexture(
(GLenum)texture
);
}
/* void glAlphaFunc ( GLenum func, GLclampf ref ) */
static void
android_glAlphaFunc__IF
(JNIEnv *_env, jobject _this, jint func, jfloat ref) {
glAlphaFunc(
(GLenum)func,
(GLclampf)ref
);
}
/* void glAlphaFuncx ( GLenum func, GLclampx ref ) */
static void
android_glAlphaFuncx__II
(JNIEnv *_env, jobject _this, jint func, jint ref) {
glAlphaFuncx(
(GLenum)func,
(GLclampx)ref
);
}
/* void glBindTexture ( GLenum target, GLuint texture ) */
static void
android_glBindTexture__II
(JNIEnv *_env, jobject _this, jint target, jint texture) {
glBindTexture(
(GLenum)target,
(GLuint)texture
);
}
/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */
static void
android_glBlendFunc__II
(JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) {
glBlendFunc(
(GLenum)sfactor,
(GLenum)dfactor
);
}
/* void glClear ( GLbitfield mask ) */
static void
android_glClear__I
(JNIEnv *_env, jobject _this, jint mask) {
glClear(
(GLbitfield)mask
);
}
/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */
static void
android_glClearColor__FFFF
(JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
glClearColor(
(GLclampf)red,
(GLclampf)green,
(GLclampf)blue,
(GLclampf)alpha
);
}
/* void glClearColorx ( GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha ) */
static void
android_glClearColorx__IIII
(JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
glClearColorx(
(GLclampx)red,
(GLclampx)green,
(GLclampx)blue,
(GLclampx)alpha
);
}
/* void glClearDepthf ( GLclampf depth ) */
static void
android_glClearDepthf__F
(JNIEnv *_env, jobject _this, jfloat depth) {
glClearDepthf(
(GLclampf)depth
);
}
/* void glClearDepthx ( GLclampx depth ) */
static void
android_glClearDepthx__I
(JNIEnv *_env, jobject _this, jint depth) {
glClearDepthx(
(GLclampx)depth
);
}
/* void glClearStencil ( GLint s ) */
static void
android_glClearStencil__I
(JNIEnv *_env, jobject _this, jint s) {
glClearStencil(
(GLint)s
);
}
/* void glClientActiveTexture ( GLenum texture ) */
static void
android_glClientActiveTexture__I
(JNIEnv *_env, jobject _this, jint texture) {
glClientActiveTexture(
(GLenum)texture
);
}
/* void glColor4f ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) */
static void
android_glColor4f__FFFF
(JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) {
glColor4f(
(GLfloat)red,
(GLfloat)green,
(GLfloat)blue,
(GLfloat)alpha
);
}
/* void glColor4x ( GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha ) */
static void
android_glColor4x__IIII
(JNIEnv *_env, jobject _this, jint red, jint green, jint blue, jint alpha) {
glColor4x(
(GLfixed)red,
(GLfixed)green,
(GLfixed)blue,
(GLfixed)alpha
);
}
/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */
static void
android_glColorMask__ZZZZ
(JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) {
glColorMask(
(GLboolean)red,
(GLboolean)green,
(GLboolean)blue,
(GLboolean)alpha
);
}
/* void glColorPointer ( GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
static void
android_glColorPointerBounds__IIILjava_nio_Buffer_2I
(JNIEnv *_env, jobject _this, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *pointer = (GLvoid *) 0;
if (pointer_buf) {
pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
if ( ! pointer ) {
return;
}
}
glColorPointerBounds(
(GLint)size,
(GLenum)type,
(GLsizei)stride,
(GLvoid *)pointer,
(GLsizei)remaining
);
}
/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */
static void
android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) {
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
if (data == NULL) {
char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
data = (GLvoid *) (_dataBase + _bufferOffset);
}
glCompressedTexImage2D(
(GLenum)target,
(GLint)level,
(GLenum)internalformat,
(GLsizei)width,
(GLsizei)height,
(GLint)border,
(GLsizei)imageSize,
(GLvoid *)data
);
if (_array) {
releasePointer(_env, _array, data, JNI_FALSE);
}
}
/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */
static void
android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) {
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *data = (GLvoid *) 0;
data = (GLvoid *)getPointer(_env, data_buf, &_array, &_remaining, &_bufferOffset);
if (data == NULL) {
char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
data = (GLvoid *) (_dataBase + _bufferOffset);
}
glCompressedTexSubImage2D(
(GLenum)target,
(GLint)level,
(GLint)xoffset,
(GLint)yoffset,
(GLsizei)width,
(GLsizei)height,
(GLenum)format,
(GLsizei)imageSize,
(GLvoid *)data
);
if (_array) {
releasePointer(_env, _array, data, JNI_FALSE);
}
}
/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */
static void
android_glCopyTexImage2D__IIIIIIII
(JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) {
glCopyTexImage2D(
(GLenum)target,
(GLint)level,
(GLenum)internalformat,
(GLint)x,
(GLint)y,
(GLsizei)width,
(GLsizei)height,
(GLint)border
);
}
/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
static void
android_glCopyTexSubImage2D__IIIIIIII
(JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) {
glCopyTexSubImage2D(
(GLenum)target,
(GLint)level,
(GLint)xoffset,
(GLint)yoffset,
(GLint)x,
(GLint)y,
(GLsizei)width,
(GLsizei)height
);
}
/* void glCullFace ( GLenum mode ) */
static void
android_glCullFace__I
(JNIEnv *_env, jobject _this, jint mode) {
glCullFace(
(GLenum)mode
);
}
/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
static void
android_glDeleteTextures__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLuint *textures_base = (GLuint *) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
if (!textures_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "textures == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(textures_ref) - offset;
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < n < needed";
goto exit;
}
textures_base = (GLuint *)
_env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
textures = textures_base + offset;
glDeleteTextures(
(GLsizei)n,
(GLuint *)textures
);
exit:
if (textures_base) {
_env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */
static void
android_glDeleteTextures__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
if (textures == NULL) {
char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
textures = (GLuint *) (_texturesBase + _bufferOffset);
}
glDeleteTextures(
(GLsizei)n,
(GLuint *)textures
);
exit:
if (_array) {
releasePointer(_env, _array, textures, JNI_FALSE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glDepthFunc ( GLenum func ) */
static void
android_glDepthFunc__I
(JNIEnv *_env, jobject _this, jint func) {
glDepthFunc(
(GLenum)func
);
}
/* void glDepthMask ( GLboolean flag ) */
static void
android_glDepthMask__Z
(JNIEnv *_env, jobject _this, jboolean flag) {
glDepthMask(
(GLboolean)flag
);
}
/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */
static void
android_glDepthRangef__FF
(JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) {
glDepthRangef(
(GLclampf)zNear,
(GLclampf)zFar
);
}
/* void glDepthRangex ( GLclampx zNear, GLclampx zFar ) */
static void
android_glDepthRangex__II
(JNIEnv *_env, jobject _this, jint zNear, jint zFar) {
glDepthRangex(
(GLclampx)zNear,
(GLclampx)zFar
);
}
/* void glDisable ( GLenum cap ) */
static void
android_glDisable__I
(JNIEnv *_env, jobject _this, jint cap) {
glDisable(
(GLenum)cap
);
}
/* void glDisableClientState ( GLenum array ) */
static void
android_glDisableClientState__I
(JNIEnv *_env, jobject _this, jint array) {
glDisableClientState(
(GLenum)array
);
}
/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */
static void
android_glDrawArrays__III
(JNIEnv *_env, jobject _this, jint mode, jint first, jint count) {
glDrawArrays(
(GLenum)mode,
(GLint)first,
(GLsizei)count
);
}
/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */
static void
android_glDrawElements__IIILjava_nio_Buffer_2
(JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLvoid *indices = (GLvoid *) 0;
indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < count) {
_exception = 1;
_exceptionType = "java/lang/ArrayIndexOutOfBoundsException";
_exceptionMessage = "remaining() < count < needed";
goto exit;
}
if (indices == NULL) {
char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
indices = (GLvoid *) (_indicesBase + _bufferOffset);
}
glDrawElements(
(GLenum)mode,
(GLsizei)count,
(GLenum)type,
(GLvoid *)indices
);
exit:
if (_array) {
releasePointer(_env, _array, indices, JNI_FALSE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glEnable ( GLenum cap ) */
static void
android_glEnable__I
(JNIEnv *_env, jobject _this, jint cap) {
glEnable(
(GLenum)cap
);
}
/* void glEnableClientState ( GLenum array ) */
static void
android_glEnableClientState__I
(JNIEnv *_env, jobject _this, jint array) {
glEnableClientState(
(GLenum)array
);
}
/* void glFinish ( void ) */
static void
android_glFinish__
(JNIEnv *_env, jobject _this) {
glFinish();
}
/* void glFlush ( void ) */
static void
android_glFlush__
(JNIEnv *_env, jobject _this) {
glFlush();
}
/* void glFogf ( GLenum pname, GLfloat param ) */
static void
android_glFogf__IF
(JNIEnv *_env, jobject _this, jint pname, jfloat param) {
glFogf(
(GLenum)pname,
(GLfloat)param
);
}
/* void glFogfv ( GLenum pname, const GLfloat *params ) */
static void
android_glFogfv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
if (!params_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "params == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
#if defined(GL_FOG_MODE)
case GL_FOG_MODE:
#endif // defined(GL_FOG_MODE)
#if defined(GL_FOG_DENSITY)
case GL_FOG_DENSITY:
#endif // defined(GL_FOG_DENSITY)
#if defined(GL_FOG_START)
case GL_FOG_START:
#endif // defined(GL_FOG_START)
#if defined(GL_FOG_END)
case GL_FOG_END:
#endif // defined(GL_FOG_END)
_needed = 1;
break;
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < needed";
goto exit;
}
params_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
glFogfv(
(GLenum)pname,
(GLfloat *)params
);
exit:
if (params_base) {
_env->ReleasePrimitiveArrayCritical(params_ref, params_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glFogfv ( GLenum pname, const GLfloat *params ) */
static void
android_glFogfv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_FOG_MODE)
case GL_FOG_MODE:
#endif // defined(GL_FOG_MODE)
#if defined(GL_FOG_DENSITY)
case GL_FOG_DENSITY:
#endif // defined(GL_FOG_DENSITY)
#if defined(GL_FOG_START)
case GL_FOG_START:
#endif // defined(GL_FOG_START)
#if defined(GL_FOG_END)
case GL_FOG_END:
#endif // defined(GL_FOG_END)
_needed = 1;
break;
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < needed";
goto exit;
}
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLfloat *) (_paramsBase + _bufferOffset);
}
glFogfv(
(GLenum)pname,
(GLfloat *)params
);
exit:
if (_array) {
releasePointer(_env, _array, params, JNI_FALSE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glFogx ( GLenum pname, GLfixed param ) */
static void
android_glFogx__II
(JNIEnv *_env, jobject _this, jint pname, jint param) {
glFogx(
(GLenum)pname,
(GLfixed)param
);
}
/* void glFogxv ( GLenum pname, const GLfixed *params ) */
static void
android_glFogxv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
if (!params_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "params == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
#if defined(GL_FOG_MODE)
case GL_FOG_MODE:
#endif // defined(GL_FOG_MODE)
#if defined(GL_FOG_DENSITY)
case GL_FOG_DENSITY:
#endif // defined(GL_FOG_DENSITY)
#if defined(GL_FOG_START)
case GL_FOG_START:
#endif // defined(GL_FOG_START)
#if defined(GL_FOG_END)
case GL_FOG_END:
#endif // defined(GL_FOG_END)
_needed = 1;
break;
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < needed";
goto exit;
}
params_base = (GLfixed *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
glFogxv(
(GLenum)pname,
(GLfixed *)params
);
exit:
if (params_base) {
_env->ReleasePrimitiveArrayCritical(params_ref, params_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glFogxv ( GLenum pname, const GLfixed *params ) */
static void
android_glFogxv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_FOG_MODE)
case GL_FOG_MODE:
#endif // defined(GL_FOG_MODE)
#if defined(GL_FOG_DENSITY)
case GL_FOG_DENSITY:
#endif // defined(GL_FOG_DENSITY)
#if defined(GL_FOG_START)
case GL_FOG_START:
#endif // defined(GL_FOG_START)
#if defined(GL_FOG_END)
case GL_FOG_END:
#endif // defined(GL_FOG_END)
_needed = 1;
break;
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < needed";
goto exit;
}
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLfixed *) (_paramsBase + _bufferOffset);
}
glFogxv(
(GLenum)pname,
(GLfixed *)params
);
exit:
if (_array) {
releasePointer(_env, _array, params, JNI_FALSE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glFrontFace ( GLenum mode ) */
static void
android_glFrontFace__I
(JNIEnv *_env, jobject _this, jint mode) {
glFrontFace(
(GLenum)mode
);
}
/* void glFrustumf ( GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar ) */
static void
android_glFrustumf__FFFFFF
(JNIEnv *_env, jobject _this, jfloat left, jfloat right, jfloat bottom, jfloat top, jfloat zNear, jfloat zFar) {
glFrustumf(
(GLfloat)left,
(GLfloat)right,
(GLfloat)bottom,
(GLfloat)top,
(GLfloat)zNear,
(GLfloat)zFar
);
}
/* void glFrustumx ( GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar ) */
static void
android_glFrustumx__IIIIII
(JNIEnv *_env, jobject _this, jint left, jint right, jint bottom, jint top, jint zNear, jint zFar) {
glFrustumx(
(GLfixed)left,
(GLfixed)right,
(GLfixed)bottom,
(GLfixed)top,
(GLfixed)zNear,
(GLfixed)zFar
);
}
/* void glGenTextures ( GLsizei n, GLuint *textures ) */
static void
android_glGenTextures__I_3II
(JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLuint *textures_base = (GLuint *) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
if (!textures_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "textures == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(textures_ref) - offset;
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < n < needed";
goto exit;
}
textures_base = (GLuint *)
_env->GetPrimitiveArrayCritical(textures_ref, (jboolean *)0);
textures = textures_base + offset;
glGenTextures(
(GLsizei)n,
(GLuint *)textures
);
exit:
if (textures_base) {
_env->ReleasePrimitiveArrayCritical(textures_ref, textures_base,
_exception ? JNI_ABORT: 0);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glGenTextures ( GLsizei n, GLuint *textures ) */
static void
android_glGenTextures__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint n, jobject textures_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLuint *textures = (GLuint *) 0;
textures = (GLuint *)getPointer(_env, textures_buf, &_array, &_remaining, &_bufferOffset);
if (_remaining < n) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < n < needed";
goto exit;
}
if (textures == NULL) {
char * _texturesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
textures = (GLuint *) (_texturesBase + _bufferOffset);
}
glGenTextures(
(GLsizei)n,
(GLuint *)textures
);
exit:
if (_array) {
releasePointer(_env, _array, textures, _exception ? JNI_FALSE : JNI_TRUE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* GLenum glGetError ( void ) */
static jint
android_glGetError__
(JNIEnv *_env, jobject _this) {
GLenum _returnValue;
_returnValue = glGetError();
return (jint)_returnValue;
}
/* void glGetIntegerv ( GLenum pname, GLint *params ) */
static void
android_glGetIntegerv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLint *params_base = (GLint *) 0;
jint _remaining;
GLint *params = (GLint *) 0;
if (!params_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "params == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
#if defined(GL_ALPHA_BITS)
case GL_ALPHA_BITS:
#endif // defined(GL_ALPHA_BITS)
#if defined(GL_ALPHA_TEST_FUNC)
case GL_ALPHA_TEST_FUNC:
#endif // defined(GL_ALPHA_TEST_FUNC)
#if defined(GL_ALPHA_TEST_REF)
case GL_ALPHA_TEST_REF:
#endif // defined(GL_ALPHA_TEST_REF)
#if defined(GL_BLEND_DST)
case GL_BLEND_DST:
#endif // defined(GL_BLEND_DST)
#if defined(GL_BLUE_BITS)
case GL_BLUE_BITS:
#endif // defined(GL_BLUE_BITS)
#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
case GL_COLOR_ARRAY_BUFFER_BINDING:
#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
#if defined(GL_COLOR_ARRAY_SIZE)
case GL_COLOR_ARRAY_SIZE:
#endif // defined(GL_COLOR_ARRAY_SIZE)
#if defined(GL_COLOR_ARRAY_STRIDE)
case GL_COLOR_ARRAY_STRIDE:
#endif // defined(GL_COLOR_ARRAY_STRIDE)
#if defined(GL_COLOR_ARRAY_TYPE)
case GL_COLOR_ARRAY_TYPE:
#endif // defined(GL_COLOR_ARRAY_TYPE)
#if defined(GL_CULL_FACE)
case GL_CULL_FACE:
#endif // defined(GL_CULL_FACE)
#if defined(GL_DEPTH_BITS)
case GL_DEPTH_BITS:
#endif // defined(GL_DEPTH_BITS)
#if defined(GL_DEPTH_CLEAR_VALUE)
case GL_DEPTH_CLEAR_VALUE:
#endif // defined(GL_DEPTH_CLEAR_VALUE)
#if defined(GL_DEPTH_FUNC)
case GL_DEPTH_FUNC:
#endif // defined(GL_DEPTH_FUNC)
#if defined(GL_DEPTH_WRITEMASK)
case GL_DEPTH_WRITEMASK:
#endif // defined(GL_DEPTH_WRITEMASK)
#if defined(GL_FOG_DENSITY)
case GL_FOG_DENSITY:
#endif // defined(GL_FOG_DENSITY)
#if defined(GL_FOG_END)
case GL_FOG_END:
#endif // defined(GL_FOG_END)
#if defined(GL_FOG_MODE)
case GL_FOG_MODE:
#endif // defined(GL_FOG_MODE)
#if defined(GL_FOG_START)
case GL_FOG_START:
#endif // defined(GL_FOG_START)
#if defined(GL_FRONT_FACE)
case GL_FRONT_FACE:
#endif // defined(GL_FRONT_FACE)
#if defined(GL_GREEN_BITS)
case GL_GREEN_BITS:
#endif // defined(GL_GREEN_BITS)
#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
case GL_LIGHT_MODEL_COLOR_CONTROL:
#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
case GL_LIGHT_MODEL_LOCAL_VIEWER:
#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
case GL_LIGHT_MODEL_TWO_SIDE:
#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
#if defined(GL_LINE_SMOOTH_HINT)
case GL_LINE_SMOOTH_HINT:
#endif // defined(GL_LINE_SMOOTH_HINT)
#if defined(GL_LINE_WIDTH)
case GL_LINE_WIDTH:
#endif // defined(GL_LINE_WIDTH)
#if defined(GL_LOGIC_OP_MODE)
case GL_LOGIC_OP_MODE:
#endif // defined(GL_LOGIC_OP_MODE)
#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
#if defined(GL_MATRIX_MODE)
case GL_MATRIX_MODE:
#endif // defined(GL_MATRIX_MODE)
#if defined(GL_MAX_CLIP_PLANES)
case GL_MAX_CLIP_PLANES:
#endif // defined(GL_MAX_CLIP_PLANES)
#if defined(GL_MAX_ELEMENTS_INDICES)
case GL_MAX_ELEMENTS_INDICES:
#endif // defined(GL_MAX_ELEMENTS_INDICES)
#if defined(GL_MAX_ELEMENTS_VERTICES)
case GL_MAX_ELEMENTS_VERTICES:
#endif // defined(GL_MAX_ELEMENTS_VERTICES)
#if defined(GL_MAX_LIGHTS)
case GL_MAX_LIGHTS:
#endif // defined(GL_MAX_LIGHTS)
#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
case GL_MAX_MODELVIEW_STACK_DEPTH:
#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
#if defined(GL_MAX_PALETTE_MATRICES_OES)
case GL_MAX_PALETTE_MATRICES_OES:
#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
case GL_MAX_PROJECTION_STACK_DEPTH:
#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
#if defined(GL_MAX_TEXTURE_SIZE)
case GL_MAX_TEXTURE_SIZE:
#endif // defined(GL_MAX_TEXTURE_SIZE)
#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
case GL_MAX_TEXTURE_STACK_DEPTH:
#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
#if defined(GL_MAX_TEXTURE_UNITS)
case GL_MAX_TEXTURE_UNITS:
#endif // defined(GL_MAX_TEXTURE_UNITS)
#if defined(GL_MAX_VERTEX_UNITS_OES)
case GL_MAX_VERTEX_UNITS_OES:
#endif // defined(GL_MAX_VERTEX_UNITS_OES)
#if defined(GL_MODELVIEW_STACK_DEPTH)
case GL_MODELVIEW_STACK_DEPTH:
#endif // defined(GL_MODELVIEW_STACK_DEPTH)
#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
case GL_NORMAL_ARRAY_BUFFER_BINDING:
#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
#if defined(GL_NORMAL_ARRAY_STRIDE)
case GL_NORMAL_ARRAY_STRIDE:
#endif // defined(GL_NORMAL_ARRAY_STRIDE)
#if defined(GL_NORMAL_ARRAY_TYPE)
case GL_NORMAL_ARRAY_TYPE:
#endif // defined(GL_NORMAL_ARRAY_TYPE)
#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
#if defined(GL_PACK_ALIGNMENT)
case GL_PACK_ALIGNMENT:
#endif // defined(GL_PACK_ALIGNMENT)
#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
case GL_PERSPECTIVE_CORRECTION_HINT:
#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
#if defined(GL_POINT_SIZE)
case GL_POINT_SIZE:
#endif // defined(GL_POINT_SIZE)
#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
case GL_POINT_SIZE_ARRAY_STRIDE_OES:
#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
case GL_POINT_SIZE_ARRAY_TYPE_OES:
#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
#if defined(GL_POINT_SMOOTH_HINT)
case GL_POINT_SMOOTH_HINT:
#endif // defined(GL_POINT_SMOOTH_HINT)
#if defined(GL_POLYGON_OFFSET_FACTOR)
case GL_POLYGON_OFFSET_FACTOR:
#endif // defined(GL_POLYGON_OFFSET_FACTOR)
#if defined(GL_POLYGON_OFFSET_UNITS)
case GL_POLYGON_OFFSET_UNITS:
#endif // defined(GL_POLYGON_OFFSET_UNITS)
#if defined(GL_PROJECTION_STACK_DEPTH)
case GL_PROJECTION_STACK_DEPTH:
#endif // defined(GL_PROJECTION_STACK_DEPTH)
#if defined(GL_RED_BITS)
case GL_RED_BITS:
#endif // defined(GL_RED_BITS)
#if defined(GL_SHADE_MODEL)
case GL_SHADE_MODEL:
#endif // defined(GL_SHADE_MODEL)
#if defined(GL_STENCIL_BITS)
case GL_STENCIL_BITS:
#endif // defined(GL_STENCIL_BITS)
#if defined(GL_STENCIL_CLEAR_VALUE)
case GL_STENCIL_CLEAR_VALUE:
#endif // defined(GL_STENCIL_CLEAR_VALUE)
#if defined(GL_STENCIL_FAIL)
case GL_STENCIL_FAIL:
#endif // defined(GL_STENCIL_FAIL)
#if defined(GL_STENCIL_FUNC)
case GL_STENCIL_FUNC:
#endif // defined(GL_STENCIL_FUNC)
#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
case GL_STENCIL_PASS_DEPTH_FAIL:
#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
#if defined(GL_STENCIL_PASS_DEPTH_PASS)
case GL_STENCIL_PASS_DEPTH_PASS:
#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
#if defined(GL_STENCIL_REF)
case GL_STENCIL_REF:
#endif // defined(GL_STENCIL_REF)
#if defined(GL_STENCIL_VALUE_MASK)
case GL_STENCIL_VALUE_MASK:
#endif // defined(GL_STENCIL_VALUE_MASK)
#if defined(GL_STENCIL_WRITEMASK)
case GL_STENCIL_WRITEMASK:
#endif // defined(GL_STENCIL_WRITEMASK)
#if defined(GL_SUBPIXEL_BITS)
case GL_SUBPIXEL_BITS:
#endif // defined(GL_SUBPIXEL_BITS)
#if defined(GL_TEXTURE_BINDING_2D)
case GL_TEXTURE_BINDING_2D:
#endif // defined(GL_TEXTURE_BINDING_2D)
#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
case GL_TEXTURE_COORD_ARRAY_SIZE:
#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
case GL_TEXTURE_COORD_ARRAY_STRIDE:
#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
case GL_TEXTURE_COORD_ARRAY_TYPE:
#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
#if defined(GL_TEXTURE_STACK_DEPTH)
case GL_TEXTURE_STACK_DEPTH:
#endif // defined(GL_TEXTURE_STACK_DEPTH)
#if defined(GL_UNPACK_ALIGNMENT)
case GL_UNPACK_ALIGNMENT:
#endif // defined(GL_UNPACK_ALIGNMENT)
#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
case GL_VERTEX_ARRAY_BUFFER_BINDING:
#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
#if defined(GL_VERTEX_ARRAY_SIZE)
case GL_VERTEX_ARRAY_SIZE:
#endif // defined(GL_VERTEX_ARRAY_SIZE)
#if defined(GL_VERTEX_ARRAY_STRIDE)
case GL_VERTEX_ARRAY_STRIDE:
#endif // defined(GL_VERTEX_ARRAY_STRIDE)
#if defined(GL_VERTEX_ARRAY_TYPE)
case GL_VERTEX_ARRAY_TYPE:
#endif // defined(GL_VERTEX_ARRAY_TYPE)
#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
case GL_WEIGHT_ARRAY_SIZE_OES:
#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
case GL_WEIGHT_ARRAY_STRIDE_OES:
#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
case GL_WEIGHT_ARRAY_TYPE_OES:
#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
_needed = 1;
break;
#if defined(GL_ALIASED_POINT_SIZE_RANGE)
case GL_ALIASED_POINT_SIZE_RANGE:
#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
case GL_ALIASED_LINE_WIDTH_RANGE:
#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
#if defined(GL_DEPTH_RANGE)
case GL_DEPTH_RANGE:
#endif // defined(GL_DEPTH_RANGE)
#if defined(GL_MAX_VIEWPORT_DIMS)
case GL_MAX_VIEWPORT_DIMS:
#endif // defined(GL_MAX_VIEWPORT_DIMS)
#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
case GL_SMOOTH_LINE_WIDTH_RANGE:
#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
case GL_SMOOTH_POINT_SIZE_RANGE:
#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
_needed = 2;
break;
#if defined(GL_COLOR_CLEAR_VALUE)
case GL_COLOR_CLEAR_VALUE:
#endif // defined(GL_COLOR_CLEAR_VALUE)
#if defined(GL_COLOR_WRITEMASK)
case GL_COLOR_WRITEMASK:
#endif // defined(GL_COLOR_WRITEMASK)
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
#if defined(GL_SCISSOR_BOX)
case GL_SCISSOR_BOX:
#endif // defined(GL_SCISSOR_BOX)
#if defined(GL_VIEWPORT)
case GL_VIEWPORT:
#endif // defined(GL_VIEWPORT)
_needed = 4;
break;
#if defined(GL_MODELVIEW_MATRIX)
case GL_MODELVIEW_MATRIX:
#endif // defined(GL_MODELVIEW_MATRIX)
#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
#if defined(GL_PROJECTION_MATRIX)
case GL_PROJECTION_MATRIX:
#endif // defined(GL_PROJECTION_MATRIX)
#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
#if defined(GL_TEXTURE_MATRIX)
case GL_TEXTURE_MATRIX:
#endif // defined(GL_TEXTURE_MATRIX)
#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
_needed = 16;
break;
#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
case GL_COMPRESSED_TEXTURE_FORMATS:
#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
_needed = getNumCompressedTextureFormats();
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < needed";
goto exit;
}
params_base = (GLint *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
glGetIntegerv(
(GLenum)pname,
(GLint *)params
);
exit:
if (params_base) {
_env->ReleasePrimitiveArrayCritical(params_ref, params_base,
_exception ? JNI_ABORT: 0);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glGetIntegerv ( GLenum pname, GLint *params ) */
static void
android_glGetIntegerv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLint *params = (GLint *) 0;
params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_ALPHA_BITS)
case GL_ALPHA_BITS:
#endif // defined(GL_ALPHA_BITS)
#if defined(GL_ALPHA_TEST_FUNC)
case GL_ALPHA_TEST_FUNC:
#endif // defined(GL_ALPHA_TEST_FUNC)
#if defined(GL_ALPHA_TEST_REF)
case GL_ALPHA_TEST_REF:
#endif // defined(GL_ALPHA_TEST_REF)
#if defined(GL_BLEND_DST)
case GL_BLEND_DST:
#endif // defined(GL_BLEND_DST)
#if defined(GL_BLUE_BITS)
case GL_BLUE_BITS:
#endif // defined(GL_BLUE_BITS)
#if defined(GL_COLOR_ARRAY_BUFFER_BINDING)
case GL_COLOR_ARRAY_BUFFER_BINDING:
#endif // defined(GL_COLOR_ARRAY_BUFFER_BINDING)
#if defined(GL_COLOR_ARRAY_SIZE)
case GL_COLOR_ARRAY_SIZE:
#endif // defined(GL_COLOR_ARRAY_SIZE)
#if defined(GL_COLOR_ARRAY_STRIDE)
case GL_COLOR_ARRAY_STRIDE:
#endif // defined(GL_COLOR_ARRAY_STRIDE)
#if defined(GL_COLOR_ARRAY_TYPE)
case GL_COLOR_ARRAY_TYPE:
#endif // defined(GL_COLOR_ARRAY_TYPE)
#if defined(GL_CULL_FACE)
case GL_CULL_FACE:
#endif // defined(GL_CULL_FACE)
#if defined(GL_DEPTH_BITS)
case GL_DEPTH_BITS:
#endif // defined(GL_DEPTH_BITS)
#if defined(GL_DEPTH_CLEAR_VALUE)
case GL_DEPTH_CLEAR_VALUE:
#endif // defined(GL_DEPTH_CLEAR_VALUE)
#if defined(GL_DEPTH_FUNC)
case GL_DEPTH_FUNC:
#endif // defined(GL_DEPTH_FUNC)
#if defined(GL_DEPTH_WRITEMASK)
case GL_DEPTH_WRITEMASK:
#endif // defined(GL_DEPTH_WRITEMASK)
#if defined(GL_FOG_DENSITY)
case GL_FOG_DENSITY:
#endif // defined(GL_FOG_DENSITY)
#if defined(GL_FOG_END)
case GL_FOG_END:
#endif // defined(GL_FOG_END)
#if defined(GL_FOG_MODE)
case GL_FOG_MODE:
#endif // defined(GL_FOG_MODE)
#if defined(GL_FOG_START)
case GL_FOG_START:
#endif // defined(GL_FOG_START)
#if defined(GL_FRONT_FACE)
case GL_FRONT_FACE:
#endif // defined(GL_FRONT_FACE)
#if defined(GL_GREEN_BITS)
case GL_GREEN_BITS:
#endif // defined(GL_GREEN_BITS)
#if defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES:
#endif // defined(GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES)
#if defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES:
#endif // defined(GL_IMPLEMENTATION_COLOR_READ_TYPE_OES)
#if defined(GL_LIGHT_MODEL_COLOR_CONTROL)
case GL_LIGHT_MODEL_COLOR_CONTROL:
#endif // defined(GL_LIGHT_MODEL_COLOR_CONTROL)
#if defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
case GL_LIGHT_MODEL_LOCAL_VIEWER:
#endif // defined(GL_LIGHT_MODEL_LOCAL_VIEWER)
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
case GL_LIGHT_MODEL_TWO_SIDE:
#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
#if defined(GL_LINE_SMOOTH_HINT)
case GL_LINE_SMOOTH_HINT:
#endif // defined(GL_LINE_SMOOTH_HINT)
#if defined(GL_LINE_WIDTH)
case GL_LINE_WIDTH:
#endif // defined(GL_LINE_WIDTH)
#if defined(GL_LOGIC_OP_MODE)
case GL_LOGIC_OP_MODE:
#endif // defined(GL_LOGIC_OP_MODE)
#if defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
case GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES:
#endif // defined(GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
#if defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
case GL_MATRIX_INDEX_ARRAY_SIZE_OES:
#endif // defined(GL_MATRIX_INDEX_ARRAY_SIZE_OES)
#if defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
case GL_MATRIX_INDEX_ARRAY_STRIDE_OES:
#endif // defined(GL_MATRIX_INDEX_ARRAY_STRIDE_OES)
#if defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
case GL_MATRIX_INDEX_ARRAY_TYPE_OES:
#endif // defined(GL_MATRIX_INDEX_ARRAY_TYPE_OES)
#if defined(GL_MATRIX_MODE)
case GL_MATRIX_MODE:
#endif // defined(GL_MATRIX_MODE)
#if defined(GL_MAX_CLIP_PLANES)
case GL_MAX_CLIP_PLANES:
#endif // defined(GL_MAX_CLIP_PLANES)
#if defined(GL_MAX_ELEMENTS_INDICES)
case GL_MAX_ELEMENTS_INDICES:
#endif // defined(GL_MAX_ELEMENTS_INDICES)
#if defined(GL_MAX_ELEMENTS_VERTICES)
case GL_MAX_ELEMENTS_VERTICES:
#endif // defined(GL_MAX_ELEMENTS_VERTICES)
#if defined(GL_MAX_LIGHTS)
case GL_MAX_LIGHTS:
#endif // defined(GL_MAX_LIGHTS)
#if defined(GL_MAX_MODELVIEW_STACK_DEPTH)
case GL_MAX_MODELVIEW_STACK_DEPTH:
#endif // defined(GL_MAX_MODELVIEW_STACK_DEPTH)
#if defined(GL_MAX_PALETTE_MATRICES_OES)
case GL_MAX_PALETTE_MATRICES_OES:
#endif // defined(GL_MAX_PALETTE_MATRICES_OES)
#if defined(GL_MAX_PROJECTION_STACK_DEPTH)
case GL_MAX_PROJECTION_STACK_DEPTH:
#endif // defined(GL_MAX_PROJECTION_STACK_DEPTH)
#if defined(GL_MAX_TEXTURE_SIZE)
case GL_MAX_TEXTURE_SIZE:
#endif // defined(GL_MAX_TEXTURE_SIZE)
#if defined(GL_MAX_TEXTURE_STACK_DEPTH)
case GL_MAX_TEXTURE_STACK_DEPTH:
#endif // defined(GL_MAX_TEXTURE_STACK_DEPTH)
#if defined(GL_MAX_TEXTURE_UNITS)
case GL_MAX_TEXTURE_UNITS:
#endif // defined(GL_MAX_TEXTURE_UNITS)
#if defined(GL_MAX_VERTEX_UNITS_OES)
case GL_MAX_VERTEX_UNITS_OES:
#endif // defined(GL_MAX_VERTEX_UNITS_OES)
#if defined(GL_MODELVIEW_STACK_DEPTH)
case GL_MODELVIEW_STACK_DEPTH:
#endif // defined(GL_MODELVIEW_STACK_DEPTH)
#if defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
case GL_NORMAL_ARRAY_BUFFER_BINDING:
#endif // defined(GL_NORMAL_ARRAY_BUFFER_BINDING)
#if defined(GL_NORMAL_ARRAY_STRIDE)
case GL_NORMAL_ARRAY_STRIDE:
#endif // defined(GL_NORMAL_ARRAY_STRIDE)
#if defined(GL_NORMAL_ARRAY_TYPE)
case GL_NORMAL_ARRAY_TYPE:
#endif // defined(GL_NORMAL_ARRAY_TYPE)
#if defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
case GL_NUM_COMPRESSED_TEXTURE_FORMATS:
#endif // defined(GL_NUM_COMPRESSED_TEXTURE_FORMATS)
#if defined(GL_PACK_ALIGNMENT)
case GL_PACK_ALIGNMENT:
#endif // defined(GL_PACK_ALIGNMENT)
#if defined(GL_PERSPECTIVE_CORRECTION_HINT)
case GL_PERSPECTIVE_CORRECTION_HINT:
#endif // defined(GL_PERSPECTIVE_CORRECTION_HINT)
#if defined(GL_POINT_SIZE)
case GL_POINT_SIZE:
#endif // defined(GL_POINT_SIZE)
#if defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES:
#endif // defined(GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES)
#if defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
case GL_POINT_SIZE_ARRAY_STRIDE_OES:
#endif // defined(GL_POINT_SIZE_ARRAY_STRIDE_OES)
#if defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
case GL_POINT_SIZE_ARRAY_TYPE_OES:
#endif // defined(GL_POINT_SIZE_ARRAY_TYPE_OES)
#if defined(GL_POINT_SMOOTH_HINT)
case GL_POINT_SMOOTH_HINT:
#endif // defined(GL_POINT_SMOOTH_HINT)
#if defined(GL_POLYGON_OFFSET_FACTOR)
case GL_POLYGON_OFFSET_FACTOR:
#endif // defined(GL_POLYGON_OFFSET_FACTOR)
#if defined(GL_POLYGON_OFFSET_UNITS)
case GL_POLYGON_OFFSET_UNITS:
#endif // defined(GL_POLYGON_OFFSET_UNITS)
#if defined(GL_PROJECTION_STACK_DEPTH)
case GL_PROJECTION_STACK_DEPTH:
#endif // defined(GL_PROJECTION_STACK_DEPTH)
#if defined(GL_RED_BITS)
case GL_RED_BITS:
#endif // defined(GL_RED_BITS)
#if defined(GL_SHADE_MODEL)
case GL_SHADE_MODEL:
#endif // defined(GL_SHADE_MODEL)
#if defined(GL_STENCIL_BITS)
case GL_STENCIL_BITS:
#endif // defined(GL_STENCIL_BITS)
#if defined(GL_STENCIL_CLEAR_VALUE)
case GL_STENCIL_CLEAR_VALUE:
#endif // defined(GL_STENCIL_CLEAR_VALUE)
#if defined(GL_STENCIL_FAIL)
case GL_STENCIL_FAIL:
#endif // defined(GL_STENCIL_FAIL)
#if defined(GL_STENCIL_FUNC)
case GL_STENCIL_FUNC:
#endif // defined(GL_STENCIL_FUNC)
#if defined(GL_STENCIL_PASS_DEPTH_FAIL)
case GL_STENCIL_PASS_DEPTH_FAIL:
#endif // defined(GL_STENCIL_PASS_DEPTH_FAIL)
#if defined(GL_STENCIL_PASS_DEPTH_PASS)
case GL_STENCIL_PASS_DEPTH_PASS:
#endif // defined(GL_STENCIL_PASS_DEPTH_PASS)
#if defined(GL_STENCIL_REF)
case GL_STENCIL_REF:
#endif // defined(GL_STENCIL_REF)
#if defined(GL_STENCIL_VALUE_MASK)
case GL_STENCIL_VALUE_MASK:
#endif // defined(GL_STENCIL_VALUE_MASK)
#if defined(GL_STENCIL_WRITEMASK)
case GL_STENCIL_WRITEMASK:
#endif // defined(GL_STENCIL_WRITEMASK)
#if defined(GL_SUBPIXEL_BITS)
case GL_SUBPIXEL_BITS:
#endif // defined(GL_SUBPIXEL_BITS)
#if defined(GL_TEXTURE_BINDING_2D)
case GL_TEXTURE_BINDING_2D:
#endif // defined(GL_TEXTURE_BINDING_2D)
#if defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING:
#endif // defined(GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING)
#if defined(GL_TEXTURE_COORD_ARRAY_SIZE)
case GL_TEXTURE_COORD_ARRAY_SIZE:
#endif // defined(GL_TEXTURE_COORD_ARRAY_SIZE)
#if defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
case GL_TEXTURE_COORD_ARRAY_STRIDE:
#endif // defined(GL_TEXTURE_COORD_ARRAY_STRIDE)
#if defined(GL_TEXTURE_COORD_ARRAY_TYPE)
case GL_TEXTURE_COORD_ARRAY_TYPE:
#endif // defined(GL_TEXTURE_COORD_ARRAY_TYPE)
#if defined(GL_TEXTURE_STACK_DEPTH)
case GL_TEXTURE_STACK_DEPTH:
#endif // defined(GL_TEXTURE_STACK_DEPTH)
#if defined(GL_UNPACK_ALIGNMENT)
case GL_UNPACK_ALIGNMENT:
#endif // defined(GL_UNPACK_ALIGNMENT)
#if defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
case GL_VERTEX_ARRAY_BUFFER_BINDING:
#endif // defined(GL_VERTEX_ARRAY_BUFFER_BINDING)
#if defined(GL_VERTEX_ARRAY_SIZE)
case GL_VERTEX_ARRAY_SIZE:
#endif // defined(GL_VERTEX_ARRAY_SIZE)
#if defined(GL_VERTEX_ARRAY_STRIDE)
case GL_VERTEX_ARRAY_STRIDE:
#endif // defined(GL_VERTEX_ARRAY_STRIDE)
#if defined(GL_VERTEX_ARRAY_TYPE)
case GL_VERTEX_ARRAY_TYPE:
#endif // defined(GL_VERTEX_ARRAY_TYPE)
#if defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
case GL_WEIGHT_ARRAY_BUFFER_BINDING_OES:
#endif // defined(GL_WEIGHT_ARRAY_BUFFER_BINDING_OES)
#if defined(GL_WEIGHT_ARRAY_SIZE_OES)
case GL_WEIGHT_ARRAY_SIZE_OES:
#endif // defined(GL_WEIGHT_ARRAY_SIZE_OES)
#if defined(GL_WEIGHT_ARRAY_STRIDE_OES)
case GL_WEIGHT_ARRAY_STRIDE_OES:
#endif // defined(GL_WEIGHT_ARRAY_STRIDE_OES)
#if defined(GL_WEIGHT_ARRAY_TYPE_OES)
case GL_WEIGHT_ARRAY_TYPE_OES:
#endif // defined(GL_WEIGHT_ARRAY_TYPE_OES)
_needed = 1;
break;
#if defined(GL_ALIASED_POINT_SIZE_RANGE)
case GL_ALIASED_POINT_SIZE_RANGE:
#endif // defined(GL_ALIASED_POINT_SIZE_RANGE)
#if defined(GL_ALIASED_LINE_WIDTH_RANGE)
case GL_ALIASED_LINE_WIDTH_RANGE:
#endif // defined(GL_ALIASED_LINE_WIDTH_RANGE)
#if defined(GL_DEPTH_RANGE)
case GL_DEPTH_RANGE:
#endif // defined(GL_DEPTH_RANGE)
#if defined(GL_MAX_VIEWPORT_DIMS)
case GL_MAX_VIEWPORT_DIMS:
#endif // defined(GL_MAX_VIEWPORT_DIMS)
#if defined(GL_SMOOTH_LINE_WIDTH_RANGE)
case GL_SMOOTH_LINE_WIDTH_RANGE:
#endif // defined(GL_SMOOTH_LINE_WIDTH_RANGE)
#if defined(GL_SMOOTH_POINT_SIZE_RANGE)
case GL_SMOOTH_POINT_SIZE_RANGE:
#endif // defined(GL_SMOOTH_POINT_SIZE_RANGE)
_needed = 2;
break;
#if defined(GL_COLOR_CLEAR_VALUE)
case GL_COLOR_CLEAR_VALUE:
#endif // defined(GL_COLOR_CLEAR_VALUE)
#if defined(GL_COLOR_WRITEMASK)
case GL_COLOR_WRITEMASK:
#endif // defined(GL_COLOR_WRITEMASK)
#if defined(GL_FOG_COLOR)
case GL_FOG_COLOR:
#endif // defined(GL_FOG_COLOR)
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
#if defined(GL_SCISSOR_BOX)
case GL_SCISSOR_BOX:
#endif // defined(GL_SCISSOR_BOX)
#if defined(GL_VIEWPORT)
case GL_VIEWPORT:
#endif // defined(GL_VIEWPORT)
_needed = 4;
break;
#if defined(GL_MODELVIEW_MATRIX)
case GL_MODELVIEW_MATRIX:
#endif // defined(GL_MODELVIEW_MATRIX)
#if defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
case GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES:
#endif // defined(GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES)
#if defined(GL_PROJECTION_MATRIX)
case GL_PROJECTION_MATRIX:
#endif // defined(GL_PROJECTION_MATRIX)
#if defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
case GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES:
#endif // defined(GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES)
#if defined(GL_TEXTURE_MATRIX)
case GL_TEXTURE_MATRIX:
#endif // defined(GL_TEXTURE_MATRIX)
#if defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
case GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES:
#endif // defined(GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES)
_needed = 16;
break;
#if defined(GL_COMPRESSED_TEXTURE_FORMATS)
case GL_COMPRESSED_TEXTURE_FORMATS:
#endif // defined(GL_COMPRESSED_TEXTURE_FORMATS)
_needed = getNumCompressedTextureFormats();
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < needed";
goto exit;
}
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLint *) (_paramsBase + _bufferOffset);
}
glGetIntegerv(
(GLenum)pname,
(GLint *)params
);
exit:
if (_array) {
releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* const GLubyte * glGetString ( GLenum name ) */
static jstring android_glGetString(JNIEnv *_env, jobject, jint name) {
const char* chars = (const char*) glGetString((GLenum) name);
return _env->NewStringUTF(chars);
}
/* void glHint ( GLenum target, GLenum mode ) */
static void
android_glHint__II
(JNIEnv *_env, jobject _this, jint target, jint mode) {
glHint(
(GLenum)target,
(GLenum)mode
);
}
/* void glLightModelf ( GLenum pname, GLfloat param ) */
static void
android_glLightModelf__IF
(JNIEnv *_env, jobject _this, jint pname, jfloat param) {
glLightModelf(
(GLenum)pname,
(GLfloat)param
);
}
/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
static void
android_glLightModelfv__I_3FI
(JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
if (!params_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "params == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
case GL_LIGHT_MODEL_TWO_SIDE:
#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
_needed = 1;
break;
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < needed";
goto exit;
}
params_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
glLightModelfv(
(GLenum)pname,
(GLfloat *)params
);
exit:
if (params_base) {
_env->ReleasePrimitiveArrayCritical(params_ref, params_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLightModelfv ( GLenum pname, const GLfloat *params ) */
static void
android_glLightModelfv__ILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
case GL_LIGHT_MODEL_TWO_SIDE:
#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
_needed = 1;
break;
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < needed";
goto exit;
}
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLfloat *) (_paramsBase + _bufferOffset);
}
glLightModelfv(
(GLenum)pname,
(GLfloat *)params
);
exit:
if (_array) {
releasePointer(_env, _array, params, JNI_FALSE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLightModelx ( GLenum pname, GLfixed param ) */
static void
android_glLightModelx__II
(JNIEnv *_env, jobject _this, jint pname, jint param) {
glLightModelx(
(GLenum)pname,
(GLfixed)param
);
}
/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
static void
android_glLightModelxv__I_3II
(JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
if (!params_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "params == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
case GL_LIGHT_MODEL_TWO_SIDE:
#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
_needed = 1;
break;
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < needed";
goto exit;
}
params_base = (GLfixed *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
glLightModelxv(
(GLenum)pname,
(GLfixed *)params
);
exit:
if (params_base) {
_env->ReleasePrimitiveArrayCritical(params_ref, params_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLightModelxv ( GLenum pname, const GLfixed *params ) */
static void
android_glLightModelxv__ILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_LIGHT_MODEL_TWO_SIDE)
case GL_LIGHT_MODEL_TWO_SIDE:
#endif // defined(GL_LIGHT_MODEL_TWO_SIDE)
_needed = 1;
break;
#if defined(GL_LIGHT_MODEL_AMBIENT)
case GL_LIGHT_MODEL_AMBIENT:
#endif // defined(GL_LIGHT_MODEL_AMBIENT)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < needed";
goto exit;
}
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLfixed *) (_paramsBase + _bufferOffset);
}
glLightModelxv(
(GLenum)pname,
(GLfixed *)params
);
exit:
if (_array) {
releasePointer(_env, _array, params, JNI_FALSE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLightf ( GLenum light, GLenum pname, GLfloat param ) */
static void
android_glLightf__IIF
(JNIEnv *_env, jobject _this, jint light, jint pname, jfloat param) {
glLightf(
(GLenum)light,
(GLenum)pname,
(GLfloat)param
);
}
/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
static void
android_glLightfv__II_3FI
(JNIEnv *_env, jobject _this, jint light, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
if (!params_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "params == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
case GL_SPOT_EXPONENT:
#endif // defined(GL_SPOT_EXPONENT)
#if defined(GL_SPOT_CUTOFF)
case GL_SPOT_CUTOFF:
#endif // defined(GL_SPOT_CUTOFF)
#if defined(GL_CONSTANT_ATTENUATION)
case GL_CONSTANT_ATTENUATION:
#endif // defined(GL_CONSTANT_ATTENUATION)
#if defined(GL_LINEAR_ATTENUATION)
case GL_LINEAR_ATTENUATION:
#endif // defined(GL_LINEAR_ATTENUATION)
#if defined(GL_QUADRATIC_ATTENUATION)
case GL_QUADRATIC_ATTENUATION:
#endif // defined(GL_QUADRATIC_ATTENUATION)
_needed = 1;
break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
_needed = 3;
break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
#if defined(GL_DIFFUSE)
case GL_DIFFUSE:
#endif // defined(GL_DIFFUSE)
#if defined(GL_SPECULAR)
case GL_SPECULAR:
#endif // defined(GL_SPECULAR)
#if defined(GL_EMISSION)
case GL_EMISSION:
#endif // defined(GL_EMISSION)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < needed";
goto exit;
}
params_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
glLightfv(
(GLenum)light,
(GLenum)pname,
(GLfloat *)params
);
exit:
if (params_base) {
_env->ReleasePrimitiveArrayCritical(params_ref, params_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLightfv ( GLenum light, GLenum pname, const GLfloat *params ) */
static void
android_glLightfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
params = (GLfloat *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
case GL_SPOT_EXPONENT:
#endif // defined(GL_SPOT_EXPONENT)
#if defined(GL_SPOT_CUTOFF)
case GL_SPOT_CUTOFF:
#endif // defined(GL_SPOT_CUTOFF)
#if defined(GL_CONSTANT_ATTENUATION)
case GL_CONSTANT_ATTENUATION:
#endif // defined(GL_CONSTANT_ATTENUATION)
#if defined(GL_LINEAR_ATTENUATION)
case GL_LINEAR_ATTENUATION:
#endif // defined(GL_LINEAR_ATTENUATION)
#if defined(GL_QUADRATIC_ATTENUATION)
case GL_QUADRATIC_ATTENUATION:
#endif // defined(GL_QUADRATIC_ATTENUATION)
_needed = 1;
break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
_needed = 3;
break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
#if defined(GL_DIFFUSE)
case GL_DIFFUSE:
#endif // defined(GL_DIFFUSE)
#if defined(GL_SPECULAR)
case GL_SPECULAR:
#endif // defined(GL_SPECULAR)
#if defined(GL_EMISSION)
case GL_EMISSION:
#endif // defined(GL_EMISSION)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < needed";
goto exit;
}
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLfloat *) (_paramsBase + _bufferOffset);
}
glLightfv(
(GLenum)light,
(GLenum)pname,
(GLfloat *)params
);
exit:
if (_array) {
releasePointer(_env, _array, params, JNI_FALSE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLightx ( GLenum light, GLenum pname, GLfixed param ) */
static void
android_glLightx__III
(JNIEnv *_env, jobject _this, jint light, jint pname, jint param) {
glLightx(
(GLenum)light,
(GLenum)pname,
(GLfixed)param
);
}
/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
static void
android_glLightxv__II_3II
(JNIEnv *_env, jobject _this, jint light, jint pname, jintArray params_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLfixed *params_base = (GLfixed *) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
if (!params_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "params == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
case GL_SPOT_EXPONENT:
#endif // defined(GL_SPOT_EXPONENT)
#if defined(GL_SPOT_CUTOFF)
case GL_SPOT_CUTOFF:
#endif // defined(GL_SPOT_CUTOFF)
#if defined(GL_CONSTANT_ATTENUATION)
case GL_CONSTANT_ATTENUATION:
#endif // defined(GL_CONSTANT_ATTENUATION)
#if defined(GL_LINEAR_ATTENUATION)
case GL_LINEAR_ATTENUATION:
#endif // defined(GL_LINEAR_ATTENUATION)
#if defined(GL_QUADRATIC_ATTENUATION)
case GL_QUADRATIC_ATTENUATION:
#endif // defined(GL_QUADRATIC_ATTENUATION)
_needed = 1;
break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
_needed = 3;
break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
#if defined(GL_DIFFUSE)
case GL_DIFFUSE:
#endif // defined(GL_DIFFUSE)
#if defined(GL_SPECULAR)
case GL_SPECULAR:
#endif // defined(GL_SPECULAR)
#if defined(GL_EMISSION)
case GL_EMISSION:
#endif // defined(GL_EMISSION)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < needed";
goto exit;
}
params_base = (GLfixed *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
glLightxv(
(GLenum)light,
(GLenum)pname,
(GLfixed *)params
);
exit:
if (params_base) {
_env->ReleasePrimitiveArrayCritical(params_ref, params_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLightxv ( GLenum light, GLenum pname, const GLfixed *params ) */
static void
android_glLightxv__IILjava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jint light, jint pname, jobject params_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *params = (GLfixed *) 0;
params = (GLfixed *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
int _needed;
switch (pname) {
#if defined(GL_SPOT_EXPONENT)
case GL_SPOT_EXPONENT:
#endif // defined(GL_SPOT_EXPONENT)
#if defined(GL_SPOT_CUTOFF)
case GL_SPOT_CUTOFF:
#endif // defined(GL_SPOT_CUTOFF)
#if defined(GL_CONSTANT_ATTENUATION)
case GL_CONSTANT_ATTENUATION:
#endif // defined(GL_CONSTANT_ATTENUATION)
#if defined(GL_LINEAR_ATTENUATION)
case GL_LINEAR_ATTENUATION:
#endif // defined(GL_LINEAR_ATTENUATION)
#if defined(GL_QUADRATIC_ATTENUATION)
case GL_QUADRATIC_ATTENUATION:
#endif // defined(GL_QUADRATIC_ATTENUATION)
_needed = 1;
break;
#if defined(GL_SPOT_DIRECTION)
case GL_SPOT_DIRECTION:
#endif // defined(GL_SPOT_DIRECTION)
_needed = 3;
break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
#if defined(GL_DIFFUSE)
case GL_DIFFUSE:
#endif // defined(GL_DIFFUSE)
#if defined(GL_SPECULAR)
case GL_SPECULAR:
#endif // defined(GL_SPECULAR)
#if defined(GL_EMISSION)
case GL_EMISSION:
#endif // defined(GL_EMISSION)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "remaining() < needed";
goto exit;
}
if (params == NULL) {
char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
params = (GLfixed *) (_paramsBase + _bufferOffset);
}
glLightxv(
(GLenum)light,
(GLenum)pname,
(GLfixed *)params
);
exit:
if (_array) {
releasePointer(_env, _array, params, JNI_FALSE);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLineWidth ( GLfloat width ) */
static void
android_glLineWidth__F
(JNIEnv *_env, jobject _this, jfloat width) {
glLineWidth(
(GLfloat)width
);
}
/* void glLineWidthx ( GLfixed width ) */
static void
android_glLineWidthx__I
(JNIEnv *_env, jobject _this, jint width) {
glLineWidthx(
(GLfixed)width
);
}
/* void glLoadIdentity ( void ) */
static void
android_glLoadIdentity__
(JNIEnv *_env, jobject _this) {
glLoadIdentity();
}
/* void glLoadMatrixf ( const GLfloat *m ) */
static void
android_glLoadMatrixf___3FI
(JNIEnv *_env, jobject _this, jfloatArray m_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLfloat *m_base = (GLfloat *) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
if (!m_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "m == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(m_ref) - offset;
m_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
m = m_base + offset;
glLoadMatrixf(
(GLfloat *)m
);
exit:
if (m_base) {
_env->ReleasePrimitiveArrayCritical(m_ref, m_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLoadMatrixf ( const GLfloat *m ) */
static void
android_glLoadMatrixf__Ljava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfloat *m = (GLfloat *) 0;
m = (GLfloat *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
if (m == NULL) {
char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
m = (GLfloat *) (_mBase + _bufferOffset);
}
glLoadMatrixf(
(GLfloat *)m
);
if (_array) {
releasePointer(_env, _array, m, JNI_FALSE);
}
}
/* void glLoadMatrixx ( const GLfixed *m ) */
static void
android_glLoadMatrixx___3II
(JNIEnv *_env, jobject _this, jintArray m_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLfixed *m_base = (GLfixed *) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
if (!m_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "m == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(m_ref) - offset;
m_base = (GLfixed *)
_env->GetPrimitiveArrayCritical(m_ref, (jboolean *)0);
m = m_base + offset;
glLoadMatrixx(
(GLfixed *)m
);
exit:
if (m_base) {
_env->ReleasePrimitiveArrayCritical(m_ref, m_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glLoadMatrixx ( const GLfixed *m ) */
static void
android_glLoadMatrixx__Ljava_nio_IntBuffer_2
(JNIEnv *_env, jobject _this, jobject m_buf) {
jarray _array = (jarray) 0;
jint _bufferOffset = (jint) 0;
jint _remaining;
GLfixed *m = (GLfixed *) 0;
m = (GLfixed *)getPointer(_env, m_buf, &_array, &_remaining, &_bufferOffset);
if (m == NULL) {
char * _mBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
m = (GLfixed *) (_mBase + _bufferOffset);
}
glLoadMatrixx(
(GLfixed *)m
);
if (_array) {
releasePointer(_env, _array, m, JNI_FALSE);
}
}
/* void glLogicOp ( GLenum opcode ) */
static void
android_glLogicOp__I
(JNIEnv *_env, jobject _this, jint opcode) {
glLogicOp(
(GLenum)opcode
);
}
/* void glMaterialf ( GLenum face, GLenum pname, GLfloat param ) */
static void
android_glMaterialf__IIF
(JNIEnv *_env, jobject _this, jint face, jint pname, jfloat param) {
glMaterialf(
(GLenum)face,
(GLenum)pname,
(GLfloat)param
);
}
/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
static void
android_glMaterialfv__II_3FI
(JNIEnv *_env, jobject _this, jint face, jint pname, jfloatArray params_ref, jint offset) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
GLfloat *params_base = (GLfloat *) 0;
jint _remaining;
GLfloat *params = (GLfloat *) 0;
if (!params_ref) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "params == null";
goto exit;
}
if (offset < 0) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "offset < 0";
goto exit;
}
_remaining = _env->GetArrayLength(params_ref) - offset;
int _needed;
switch (pname) {
#if defined(GL_SHININESS)
case GL_SHININESS:
#endif // defined(GL_SHININESS)
_needed = 1;
break;
#if defined(GL_AMBIENT)
case GL_AMBIENT:
#endif // defined(GL_AMBIENT)
#if defined(GL_DIFFUSE)
case GL_DIFFUSE:
#endif // defined(GL_DIFFUSE)
#if defined(GL_SPECULAR)
case GL_SPECULAR:
#endif // defined(GL_SPECULAR)
#if defined(GL_EMISSION)
case GL_EMISSION:
#endif // defined(GL_EMISSION)
#if defined(GL_AMBIENT_AND_DIFFUSE)
case GL_AMBIENT_AND_DIFFUSE:
#endif // defined(GL_AMBIENT_AND_DIFFUSE)
_needed = 4;
break;
default:
_needed = 1;
break;
}
if (_remaining < _needed) {
_exception = 1;
_exceptionType = "java/lang/IllegalArgumentException";
_exceptionMessage = "length - offset < needed";
goto exit;
}
params_base = (GLfloat *)
_env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
params = params_base + offset;
glMaterialfv(
(GLenum)face,
(GLenum)pname,
(GLfloat *)params
);
exit:
if (params_base) {
_env->ReleasePrimitiveArrayCritical(params_ref, params_base,
JNI_ABORT);
}
if (_exception) {
jniThrowException(_env, _exceptionType, _exceptionMessage);
}
}
/* void glMaterialfv ( GLenum face, GLenum pname, const GLfloat *params ) */
static void
android_glMaterialfv__IILjava_nio_FloatBuffer_2
(JNIEnv *_env, jobject _this, jint face, jint pname, jobject params_buf) {
jint _exception = 0;
const char * _exceptionType = NULL;
const char * _exceptionMessage = NULL;
jarray _array = (jarray) 0;