/core/jni/android_opengl_GLES30.cpp
C++ | 5363 lines | 4722 code | 437 blank | 204 comment | 477 complexity | dae2aa21535ace3b479da85ff91c5111 MD5 | raw file
Possible License(s): LGPL-2.1, MPL-2.0-no-copyleft-exception, CC0-1.0, BitTorrent-1.0, BSD-3-Clause
Large files files are truncated, but you can click here to view the full file
- /*
- **
- ** Copyright 2013, 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
- #pragma GCC diagnostic ignored "-Wunused-variable"
- #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
- #pragma GCC diagnostic ignored "-Wunused-function"
- #include <GLES3/gl3.h>
- #include <GLES3/gl3ext.h>
- #include <jni.h>
- #include <JNIHelp.h>
- #include <android_runtime/AndroidRuntime.h>
- #include <utils/misc.h>
- #include <assert.h>
- static int initialized = 0;
- static jclass nioAccessClass;
- static jclass bufferClass;
- static jmethodID getBasePointerID;
- static jmethodID getBaseArrayID;
- static jmethodID getBaseArrayOffsetID;
- static jfieldID positionID;
- static jfieldID limitID;
- static jfieldID elementSizeShiftID;
- /* special calls implemented in Android's GLES wrapper used to more
- * efficiently bound-check passed arrays */
- extern "C" {
- #ifdef GL_VERSION_ES_CM_1_1
- 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);
- #endif
- #ifdef GL_ES_VERSION_2_0
- static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
- GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
- }
- #endif
- #ifdef GL_ES_VERSION_3_0
- static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
- GLsizei stride, const GLvoid *pointer, GLsizei count) {
- glVertexAttribIPointer(indx, size, type, stride, pointer);
- }
- #endif
- }
- /* 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);
- 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");
- 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);
- *offset = _env->CallStaticIntMethod(nioAccessClass,
- getBaseArrayOffsetID, buffer);
- return NULL;
- }
- class ByteArrayGetter {
- public:
- static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
- return _env->GetByteArrayElements(array, is_copy);
- }
- };
- class BooleanArrayGetter {
- public:
- static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
- return _env->GetBooleanArrayElements(array, is_copy);
- }
- };
- class CharArrayGetter {
- public:
- static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
- return _env->GetCharArrayElements(array, is_copy);
- }
- };
- class ShortArrayGetter {
- public:
- static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
- return _env->GetShortArrayElements(array, is_copy);
- }
- };
- class IntArrayGetter {
- public:
- static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
- return _env->GetIntArrayElements(array, is_copy);
- }
- };
- class LongArrayGetter {
- public:
- static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
- return _env->GetLongArrayElements(array, is_copy);
- }
- };
- class FloatArrayGetter {
- public:
- static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
- return _env->GetFloatArrayElements(array, is_copy);
- }
- };
- class DoubleArrayGetter {
- public:
- static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
- return _env->GetDoubleArrayElements(array, is_copy);
- }
- };
- template<typename JTYPEARRAY, typename ARRAYGETTER>
- static void*
- getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
- return ARRAYGETTER::Get(_env, array, is_copy);
- }
- class ByteArrayReleaser {
- public:
- static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
- _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
- }
- };
- class BooleanArrayReleaser {
- public:
- static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
- _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
- }
- };
- class CharArrayReleaser {
- public:
- static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
- _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
- }
- };
- class ShortArrayReleaser {
- public:
- static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
- _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
- }
- };
- class IntArrayReleaser {
- public:
- static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
- _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
- }
- };
- class LongArrayReleaser {
- public:
- static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
- _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
- }
- };
- class FloatArrayReleaser {
- public:
- static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
- _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
- }
- };
- class DoubleArrayReleaser {
- public:
- static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
- _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
- }
- };
- template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
- static void
- releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
- ARRAYRELEASER::Release(_env, array, data, commit);
- }
- static void
- releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
- {
- _env->ReleasePrimitiveArrayCritical(array, data,
- commit ? 0 : JNI_ABORT);
- }
- static void *
- getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
- char* buf = (char*) _env->GetDirectBufferAddress(buffer);
- if (buf) {
- jint position = _env->GetIntField(buffer, positionID);
- jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
- buf += position << elementSizeShift;
- } else {
- jniThrowException(_env, "java/lang/IllegalArgumentException",
- "Must use a native order direct Buffer");
- }
- return (void*) buf;
- }
- // --------------------------------------------------------------------------
- /*
- * returns the number of values glGet returns for a given pname.
- *
- * The code below is written such that pnames requiring only one values
- * are the default (and are not explicitely tested for). This makes the
- * checking code much shorter/readable/efficient.
- *
- * This means that unknown pnames (e.g.: extensions) will default to 1. If
- * that unknown pname needs more than 1 value, then the validation check
- * is incomplete and the app may crash if it passed the wrong number params.
- */
- static int getNeededCount(GLint pname) {
- int needed = 1;
- #ifdef GL_ES_VERSION_2_0
- // GLES 2.x pnames
- switch (pname) {
- case GL_ALIASED_LINE_WIDTH_RANGE:
- case GL_ALIASED_POINT_SIZE_RANGE:
- needed = 2;
- break;
- case GL_BLEND_COLOR:
- case GL_COLOR_CLEAR_VALUE:
- case GL_COLOR_WRITEMASK:
- case GL_SCISSOR_BOX:
- case GL_VIEWPORT:
- needed = 4;
- break;
- case GL_COMPRESSED_TEXTURE_FORMATS:
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
- break;
- case GL_SHADER_BINARY_FORMATS:
- glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
- break;
- }
- #endif
- #ifdef GL_VERSION_ES_CM_1_1
- // GLES 1.x pnames
- switch (pname) {
- case GL_ALIASED_LINE_WIDTH_RANGE:
- case GL_ALIASED_POINT_SIZE_RANGE:
- case GL_DEPTH_RANGE:
- case GL_SMOOTH_LINE_WIDTH_RANGE:
- case GL_SMOOTH_POINT_SIZE_RANGE:
- needed = 2;
- break;
- case GL_CURRENT_NORMAL:
- case GL_POINT_DISTANCE_ATTENUATION:
- needed = 3;
- break;
- case GL_COLOR_CLEAR_VALUE:
- case GL_COLOR_WRITEMASK:
- case GL_CURRENT_COLOR:
- case GL_CURRENT_TEXTURE_COORDS:
- case GL_FOG_COLOR:
- case GL_LIGHT_MODEL_AMBIENT:
- case GL_SCISSOR_BOX:
- case GL_VIEWPORT:
- needed = 4;
- break;
- case GL_MODELVIEW_MATRIX:
- case GL_PROJECTION_MATRIX:
- case GL_TEXTURE_MATRIX:
- needed = 16;
- break;
- case GL_COMPRESSED_TEXTURE_FORMATS:
- glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
- break;
- }
- #endif
- return needed;
- }
- template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
- typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
- static void
- get
- (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- CTYPE *params_base = (CTYPE *) 0;
- jint _remaining;
- CTYPE *params = (CTYPE *) 0;
- int _needed = 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;
- _needed = getNeededCount(pname);
- // if we didn't find this pname, we just assume the user passed
- // an array of the right size -- this might happen with extensions
- // or if we forget an enum here.
- if (_remaining < _needed) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "length - offset < needed";
- goto exit;
- }
- params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
- _env, params_ref, (jboolean *)0);
- params = params_base + offset;
- GET(
- (GLenum)pname,
- (CTYPE *)params
- );
- exit:
- if (params_base) {
- releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
- _env, params_ref, params_base, !_exception);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
- typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
- static void
- getarray
- (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
- jint _exception = 0;
- const char * _exceptionType;
- const char * _exceptionMessage;
- JTYPEARRAY _array = (JTYPEARRAY) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- CTYPE *params = (CTYPE *) 0;
- int _needed = 0;
- params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- _remaining /= sizeof(CTYPE); // convert from bytes to item count
- _needed = getNeededCount(pname);
- // if we didn't find this pname, we just assume the user passed
- // an array of the right size -- this might happen with extensions
- // or if we forget an enum here.
- if (_needed>0 && _remaining < _needed) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "remaining() < needed";
- goto exit;
- }
- if (params == NULL) {
- char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
- _env, _array, (jboolean *) 0);
- params = (CTYPE *) (_paramsBase + _bufferOffset);
- }
- GET(
- (GLenum)pname,
- (CTYPE *)params
- );
- exit:
- if (_array) {
- releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
- _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- // --------------------------------------------------------------------------
- /* void glReadBuffer ( GLenum mode ) */
- static void
- android_glReadBuffer__I
- (JNIEnv *_env, jobject _this, jint mode) {
- glReadBuffer(
- (GLenum)mode
- );
- }
- /* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) */
- static void
- android_glDrawRangeElements__IIIIILjava_nio_Buffer_2
- (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf) {
- jarray _array = (jarray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLvoid *indices = (GLvoid *) 0;
- indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (indices == NULL) {
- char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- indices = (GLvoid *) (_indicesBase + _bufferOffset);
- }
- glDrawRangeElements(
- (GLenum)mode,
- (GLuint)start,
- (GLuint)end,
- (GLsizei)count,
- (GLenum)type,
- (GLvoid *)indices
- );
- if (_array) {
- releasePointer(_env, _array, indices, JNI_FALSE);
- }
- }
- /* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) */
- static void
- android_glDrawRangeElements__IIIIII
- (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jint offset) {
- glDrawRangeElements(
- (GLenum)mode,
- (GLuint)start,
- (GLuint)end,
- (GLsizei)count,
- (GLenum)type,
- reinterpret_cast<GLvoid *>(offset)
- );
- }
- /* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
- static void
- android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2
- (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jobject pixels_buf) {
- jarray _array = (jarray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLvoid *pixels = (GLvoid *) 0;
- if (pixels_buf) {
- pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- }
- if (pixels_buf && pixels == NULL) {
- char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
- }
- glTexImage3D(
- (GLenum)target,
- (GLint)level,
- (GLint)internalformat,
- (GLsizei)width,
- (GLsizei)height,
- (GLsizei)depth,
- (GLint)border,
- (GLenum)format,
- (GLenum)type,
- (GLvoid *)pixels
- );
- if (_array) {
- releasePointer(_env, _array, pixels, JNI_FALSE);
- }
- }
- /* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei offset ) */
- static void
- android_glTexImage3D__IIIIIIIIII
- (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jint offset) {
- glTexImage3D(
- (GLenum)target,
- (GLint)level,
- (GLint)internalformat,
- (GLsizei)width,
- (GLsizei)height,
- (GLsizei)depth,
- (GLint)border,
- (GLenum)format,
- (GLenum)type,
- reinterpret_cast<GLvoid *>(offset)
- );
- }
- /* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels ) */
- static void
- android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
- (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jobject pixels_buf) {
- jarray _array = (jarray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLvoid *pixels = (GLvoid *) 0;
- pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (pixels == NULL) {
- char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
- }
- glTexSubImage3D(
- (GLenum)target,
- (GLint)level,
- (GLint)xoffset,
- (GLint)yoffset,
- (GLint)zoffset,
- (GLsizei)width,
- (GLsizei)height,
- (GLsizei)depth,
- (GLenum)format,
- (GLenum)type,
- (GLvoid *)pixels
- );
- if (_array) {
- releasePointer(_env, _array, pixels, JNI_FALSE);
- }
- }
- /* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei offset ) */
- static void
- android_glTexSubImage3D__IIIIIIIIIII
- (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jint offset) {
- glTexSubImage3D(
- (GLenum)target,
- (GLint)level,
- (GLint)xoffset,
- (GLint)yoffset,
- (GLint)zoffset,
- (GLsizei)width,
- (GLsizei)height,
- (GLsizei)depth,
- (GLenum)format,
- (GLenum)type,
- reinterpret_cast<GLvoid *>(offset)
- );
- }
- /* void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
- static void
- android_glCopyTexSubImage3D__IIIIIIIII
- (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) {
- glCopyTexSubImage3D(
- (GLenum)target,
- (GLint)level,
- (GLint)xoffset,
- (GLint)yoffset,
- (GLint)zoffset,
- (GLint)x,
- (GLint)y,
- (GLsizei)width,
- (GLsizei)height
- );
- }
- /* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) */
- static void
- android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2
- (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, 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, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (data == NULL) {
- char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- data = (GLvoid *) (_dataBase + _bufferOffset);
- }
- glCompressedTexImage3D(
- (GLenum)target,
- (GLint)level,
- (GLenum)internalformat,
- (GLsizei)width,
- (GLsizei)height,
- (GLsizei)depth,
- (GLint)border,
- (GLsizei)imageSize,
- (GLvoid *)data
- );
- if (_array) {
- releasePointer(_env, _array, data, JNI_FALSE);
- }
- }
- /* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei offset ) */
- static void
- android_glCompressedTexImage3D__IIIIIIIII
- (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jint offset) {
- glCompressedTexImage3D(
- (GLenum)target,
- (GLint)level,
- (GLenum)internalformat,
- (GLsizei)width,
- (GLsizei)height,
- (GLsizei)depth,
- (GLint)border,
- (GLsizei)imageSize,
- reinterpret_cast<GLvoid *>(offset)
- );
- }
- /* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ) */
- static void
- android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
- (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, 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, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (data == NULL) {
- char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
- data = (GLvoid *) (_dataBase + _bufferOffset);
- }
- glCompressedTexSubImage3D(
- (GLenum)target,
- (GLint)level,
- (GLint)xoffset,
- (GLint)yoffset,
- (GLint)zoffset,
- (GLsizei)width,
- (GLsizei)height,
- (GLsizei)depth,
- (GLenum)format,
- (GLsizei)imageSize,
- (GLvoid *)data
- );
- if (_array) {
- releasePointer(_env, _array, data, JNI_FALSE);
- }
- }
- /* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei offset ) */
- static void
- android_glCompressedTexSubImage3D__IIIIIIIIIII
- (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jint offset) {
- glCompressedTexSubImage3D(
- (GLenum)target,
- (GLint)level,
- (GLint)xoffset,
- (GLint)yoffset,
- (GLint)zoffset,
- (GLsizei)width,
- (GLsizei)height,
- (GLsizei)depth,
- (GLenum)format,
- (GLsizei)imageSize,
- reinterpret_cast<GLvoid *>(offset)
- );
- }
- /* void glGenQueries ( GLsizei n, GLuint *ids ) */
- static void
- android_glGenQueries__I_3II
- (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLuint *ids_base = (GLuint *) 0;
- jint _remaining;
- GLuint *ids = (GLuint *) 0;
- if (!ids_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "ids == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(ids_ref) - offset;
- ids_base = (GLuint *)
- _env->GetIntArrayElements(ids_ref, (jboolean *)0);
- ids = ids_base + offset;
- glGenQueries(
- (GLsizei)n,
- (GLuint *)ids
- );
- exit:
- if (ids_base) {
- _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
- _exception ? JNI_ABORT: 0);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glGenQueries ( GLsizei n, GLuint *ids ) */
- static void
- android_glGenQueries__ILjava_nio_IntBuffer_2
- (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
- jintArray _array = (jintArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLuint *ids = (GLuint *) 0;
- ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (ids == NULL) {
- char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
- ids = (GLuint *) (_idsBase + _bufferOffset);
- }
- glGenQueries(
- (GLsizei)n,
- (GLuint *)ids
- );
- if (_array) {
- _env->ReleaseIntArrayElements(_array, (jint*)ids, 0);
- }
- }
- /* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
- static void
- android_glDeleteQueries__I_3II
- (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLuint *ids_base = (GLuint *) 0;
- jint _remaining;
- GLuint *ids = (GLuint *) 0;
- if (!ids_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "ids == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(ids_ref) - offset;
- ids_base = (GLuint *)
- _env->GetIntArrayElements(ids_ref, (jboolean *)0);
- ids = ids_base + offset;
- glDeleteQueries(
- (GLsizei)n,
- (GLuint *)ids
- );
- exit:
- if (ids_base) {
- _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
- JNI_ABORT);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
- static void
- android_glDeleteQueries__ILjava_nio_IntBuffer_2
- (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
- jintArray _array = (jintArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLuint *ids = (GLuint *) 0;
- ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (ids == NULL) {
- char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
- ids = (GLuint *) (_idsBase + _bufferOffset);
- }
- glDeleteQueries(
- (GLsizei)n,
- (GLuint *)ids
- );
- if (_array) {
- _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
- }
- }
- /* GLboolean glIsQuery ( GLuint id ) */
- static jboolean
- android_glIsQuery__I
- (JNIEnv *_env, jobject _this, jint id) {
- GLboolean _returnValue;
- _returnValue = glIsQuery(
- (GLuint)id
- );
- return (jboolean)_returnValue;
- }
- /* void glBeginQuery ( GLenum target, GLuint id ) */
- static void
- android_glBeginQuery__II
- (JNIEnv *_env, jobject _this, jint target, jint id) {
- glBeginQuery(
- (GLenum)target,
- (GLuint)id
- );
- }
- /* void glEndQuery ( GLenum target ) */
- static void
- android_glEndQuery__I
- (JNIEnv *_env, jobject _this, jint target) {
- glEndQuery(
- (GLenum)target
- );
- }
- /* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
- static void
- android_glGetQueryiv__II_3II
- (JNIEnv *_env, jobject _this, jint target, 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;
- params_base = (GLint *)
- _env->GetIntArrayElements(params_ref, (jboolean *)0);
- params = params_base + offset;
- glGetQueryiv(
- (GLenum)target,
- (GLenum)pname,
- (GLint *)params
- );
- exit:
- if (params_base) {
- _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
- _exception ? JNI_ABORT: 0);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
- static void
- android_glGetQueryiv__IILjava_nio_IntBuffer_2
- (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
- jintArray _array = (jintArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLint *params = (GLint *) 0;
- params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (params == NULL) {
- char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
- params = (GLint *) (_paramsBase + _bufferOffset);
- }
- glGetQueryiv(
- (GLenum)target,
- (GLenum)pname,
- (GLint *)params
- );
- if (_array) {
- _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
- }
- }
- /* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
- static void
- android_glGetQueryObjectuiv__II_3II
- (JNIEnv *_env, jobject _this, jint id, jint pname, jintArray params_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLuint *params_base = (GLuint *) 0;
- jint _remaining;
- GLuint *params = (GLuint *) 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;
- params_base = (GLuint *)
- _env->GetIntArrayElements(params_ref, (jboolean *)0);
- params = params_base + offset;
- glGetQueryObjectuiv(
- (GLuint)id,
- (GLenum)pname,
- (GLuint *)params
- );
- exit:
- if (params_base) {
- _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
- _exception ? JNI_ABORT: 0);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
- static void
- android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2
- (JNIEnv *_env, jobject _this, jint id, jint pname, jobject params_buf) {
- jintArray _array = (jintArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLuint *params = (GLuint *) 0;
- params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (params == NULL) {
- char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
- params = (GLuint *) (_paramsBase + _bufferOffset);
- }
- glGetQueryObjectuiv(
- (GLuint)id,
- (GLenum)pname,
- (GLuint *)params
- );
- if (_array) {
- _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
- }
- }
- /* GLboolean glUnmapBuffer ( GLenum target ) */
- static jboolean
- android_glUnmapBuffer__I
- (JNIEnv *_env, jobject _this, jint target) {
- GLboolean _returnValue;
- _returnValue = glUnmapBuffer(
- (GLenum)target
- );
- return (jboolean)_returnValue;
- }
- /* void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) */
- static jobject
- android_glGetBufferPointerv__II
- (JNIEnv *_env, jobject _this, jint target, jint pname) {
- GLint64 _mapLength;
- GLvoid* _p;
- glGetBufferParameteri64v((GLenum)target, GL_BUFFER_MAP_LENGTH, &_mapLength);
- glGetBufferPointerv((GLenum)target, (GLenum)pname, &_p);
- return _env->NewDirectByteBuffer(_p, _mapLength);
- }
- /* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
- static void
- android_glDrawBuffers__I_3II
- (JNIEnv *_env, jobject _this, jint n, jintArray bufs_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLenum *bufs_base = (GLenum *) 0;
- jint _remaining;
- GLenum *bufs = (GLenum *) 0;
- if (!bufs_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "bufs == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(bufs_ref) - offset;
- bufs_base = (GLenum *)
- _env->GetIntArrayElements(bufs_ref, (jboolean *)0);
- bufs = bufs_base + offset;
- glDrawBuffers(
- (GLsizei)n,
- (GLenum *)bufs
- );
- exit:
- if (bufs_base) {
- _env->ReleaseIntArrayElements(bufs_ref, (jint*)bufs_base,
- JNI_ABORT);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
- static void
- android_glDrawBuffers__ILjava_nio_IntBuffer_2
- (JNIEnv *_env, jobject _this, jint n, jobject bufs_buf) {
- jintArray _array = (jintArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLenum *bufs = (GLenum *) 0;
- bufs = (GLenum *)getPointer(_env, bufs_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (bufs == NULL) {
- char * _bufsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
- bufs = (GLenum *) (_bufsBase + _bufferOffset);
- }
- glDrawBuffers(
- (GLsizei)n,
- (GLenum *)bufs
- );
- if (_array) {
- _env->ReleaseIntArrayElements(_array, (jint*)bufs, JNI_ABORT);
- }
- }
- /* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix2x3fv__IIZ_3FI
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLfloat *value_base = (GLfloat *) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- if (!value_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "value == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(value_ref) - offset;
- value_base = (GLfloat *)
- _env->GetFloatArrayElements(value_ref, (jboolean *)0);
- value = value_base + offset;
- glUniformMatrix2x3fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- exit:
- if (value_base) {
- _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
- JNI_ABORT);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
- jfloatArray _array = (jfloatArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (value == NULL) {
- char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
- value = (GLfloat *) (_valueBase + _bufferOffset);
- }
- glUniformMatrix2x3fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- if (_array) {
- _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
- }
- }
- /* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix3x2fv__IIZ_3FI
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLfloat *value_base = (GLfloat *) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- if (!value_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "value == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(value_ref) - offset;
- value_base = (GLfloat *)
- _env->GetFloatArrayElements(value_ref, (jboolean *)0);
- value = value_base + offset;
- glUniformMatrix3x2fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- exit:
- if (value_base) {
- _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
- JNI_ABORT);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
- jfloatArray _array = (jfloatArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (value == NULL) {
- char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
- value = (GLfloat *) (_valueBase + _bufferOffset);
- }
- glUniformMatrix3x2fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- if (_array) {
- _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
- }
- }
- /* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix2x4fv__IIZ_3FI
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLfloat *value_base = (GLfloat *) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- if (!value_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "value == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(value_ref) - offset;
- value_base = (GLfloat *)
- _env->GetFloatArrayElements(value_ref, (jboolean *)0);
- value = value_base + offset;
- glUniformMatrix2x4fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- exit:
- if (value_base) {
- _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
- JNI_ABORT);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
- jfloatArray _array = (jfloatArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (value == NULL) {
- char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
- value = (GLfloat *) (_valueBase + _bufferOffset);
- }
- glUniformMatrix2x4fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- if (_array) {
- _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
- }
- }
- /* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix4x2fv__IIZ_3FI
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLfloat *value_base = (GLfloat *) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- if (!value_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "value == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(value_ref) - offset;
- value_base = (GLfloat *)
- _env->GetFloatArrayElements(value_ref, (jboolean *)0);
- value = value_base + offset;
- glUniformMatrix4x2fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- exit:
- if (value_base) {
- _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
- JNI_ABORT);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
- jfloatArray _array = (jfloatArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (value == NULL) {
- char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
- value = (GLfloat *) (_valueBase + _bufferOffset);
- }
- glUniformMatrix4x2fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- if (_array) {
- _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
- }
- }
- /* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix3x4fv__IIZ_3FI
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLfloat *value_base = (GLfloat *) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- if (!value_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "value == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(value_ref) - offset;
- value_base = (GLfloat *)
- _env->GetFloatArrayElements(value_ref, (jboolean *)0);
- value = value_base + offset;
- glUniformMatrix3x4fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- exit:
- if (value_base) {
- _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
- JNI_ABORT);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
- jfloatArray _array = (jfloatArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (value == NULL) {
- char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
- value = (GLfloat *) (_valueBase + _bufferOffset);
- }
- glUniformMatrix3x4fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- if (_array) {
- _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
- }
- }
- /* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix4x3fv__IIZ_3FI
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
- jint _exception = 0;
- const char * _exceptionType = NULL;
- const char * _exceptionMessage = NULL;
- GLfloat *value_base = (GLfloat *) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- if (!value_ref) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "value == null";
- goto exit;
- }
- if (offset < 0) {
- _exception = 1;
- _exceptionType = "java/lang/IllegalArgumentException";
- _exceptionMessage = "offset < 0";
- goto exit;
- }
- _remaining = _env->GetArrayLength(value_ref) - offset;
- value_base = (GLfloat *)
- _env->GetFloatArrayElements(value_ref, (jboolean *)0);
- value = value_base + offset;
- glUniformMatrix4x3fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- exit:
- if (value_base) {
- _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
- JNI_ABORT);
- }
- if (_exception) {
- jniThrowException(_env, _exceptionType, _exceptionMessage);
- }
- }
- /* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
- static void
- android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2
- (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
- jfloatArray _array = (jfloatArray) 0;
- jint _bufferOffset = (jint) 0;
- jint _remaining;
- GLfloat *value = (GLfloat *) 0;
- value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
- if (value == NULL) {
- char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
- value = (GLfloat *) (_valueBase + _bufferOffset);
- }
- glUniformMatrix4x3fv(
- (GLint)location,
- (GLsizei)count,
- (GLboolean)transpose,
- (GLfloat *)value
- );
- if (_array) {
- _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
- }
- }
- /* void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, G…
Large files files are truncated, but you can click here to view the full file