android_opengl_GLES20.cpp revision 2279b2534272282a5b5152723235da397e49195c
1560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* 2560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich** 3560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich** Copyright 2009, The Android Open Source Project 4560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich** 524ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes** Licensed under the Apache License, Version 2.0 (the "License"); 624ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes** you may not use this file except in compliance with the License. 724ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes** You may obtain a copy of the License at 8560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich** 924ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes** http://www.apache.org/licenses/LICENSE-2.0 10560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich** 1124ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes** Unless required by applicable law or agreed to in writing, software 1224ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes** distributed under the License is distributed on an "AS IS" BASIS, 1324ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1424ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes** See the License for the specific language governing permissions and 15560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich** limitations under the License. 16560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich*/ 17560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 18560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich// This source file is automatically generated 19560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 20bfe6333c3cf529600f41f14e3b8c5846e632c9a2Andreas Gampe#pragma GCC diagnostic ignored "-Wunused-variable" 21bfe6333c3cf529600f41f14e3b8c5846e632c9a2Andreas Gampe#pragma GCC diagnostic ignored "-Wunused-but-set-variable" 22bfe6333c3cf529600f41f14e3b8c5846e632c9a2Andreas Gampe#pragma GCC diagnostic ignored "-Wunused-function" 23bfe6333c3cf529600f41f14e3b8c5846e632c9a2Andreas Gampe 242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#include <GLES2/gl2.h> 252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#include <GLES2/gl2ext.h> 262ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 279626f8203a8c222b8960a49cdc66d540fdb688b0Jesse Hall#include <jni.h> 282279b2534272282a5b5152723235da397e49195cSteven Moreland#include <nativehelper/JNIHelp.h> 29560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich#include <android_runtime/AndroidRuntime.h> 30560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich#include <utils/misc.h> 31560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich#include <assert.h> 32560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 33560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic int initialized = 0; 34560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 35560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jclass nioAccessClass; 36560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jclass bufferClass; 37560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jmethodID getBasePointerID; 38560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jmethodID getBaseArrayID; 39560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jmethodID getBaseArrayOffsetID; 40560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jfieldID positionID; 41560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jfieldID limitID; 42560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jfieldID elementSizeShiftID; 43560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian/* special calls implemented in Android's GLES wrapper used to more 462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * efficiently bound-check passed arrays */ 472ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianextern "C" { 482ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#ifdef GL_VERSION_ES_CM_1_1 492ad0477f16c64dc3126741933f11e27353521bb4Mathias AgopianGL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, 502ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const GLvoid *ptr, GLsizei count); 512ad0477f16c64dc3126741933f11e27353521bb4Mathias AgopianGL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, 522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const GLvoid *pointer, GLsizei count); 532ad0477f16c64dc3126741933f11e27353521bb4Mathias AgopianGL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, 542ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian GLsizei stride, const GLvoid *pointer, GLsizei count); 552ad0477f16c64dc3126741933f11e27353521bb4Mathias AgopianGL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, 562ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian GLsizei stride, const GLvoid *pointer, GLsizei count); 572ad0477f16c64dc3126741933f11e27353521bb4Mathias AgopianGL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, 582ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian GLsizei stride, const GLvoid *pointer, GLsizei count); 592ad0477f16c64dc3126741933f11e27353521bb4Mathias AgopianGL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, 602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian GLsizei stride, const GLvoid *pointer, GLsizei count); 612ad0477f16c64dc3126741933f11e27353521bb4Mathias AgopianGL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, 622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian GLsizei stride, const GLvoid *pointer, GLsizei count); 632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#endif 642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#ifdef GL_ES_VERSION_2_0 652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianstatic void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type, 662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) { 672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian glVertexAttribPointer(indx, size, type, normalized, stride, pointer); 682ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian} 692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#endif 70cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden#ifdef GL_ES_VERSION_3_0 71cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFaddenstatic void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type, 72cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden GLsizei stride, const GLvoid *pointer, GLsizei count) { 73cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden glVertexAttribIPointer(indx, size, type, stride, pointer); 74cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden} 75cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden#endif 762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian} 772ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 78560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* Cache method IDs each time the class is loaded. */ 79560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 80560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 8124ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott HughesnativeClassInit(JNIEnv *_env, jclass glImplClass) 82560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{ 83560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); 84560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); 85560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 86560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jclass bufferClassLocal = _env->FindClass("java/nio/Buffer"); 87560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal); 88560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 89560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich getBasePointerID = _env->GetStaticMethodID(nioAccessClass, 90560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich "getBasePointer", "(Ljava/nio/Buffer;)J"); 91560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich getBaseArrayID = _env->GetStaticMethodID(nioAccessClass, 92560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;"); 93560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass, 94560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich "getBaseArrayOffset", "(Ljava/nio/Buffer;)I"); 95560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 96560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich positionID = _env->GetFieldID(bufferClass, "position", "I"); 97560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich limitID = _env->GetFieldID(bufferClass, "limit", "I"); 98560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich elementSizeShiftID = 99560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); 100560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 101560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 102560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void * 10317045a16575ece34cfadb63da4791f115625df78Thomas TafertshofergetPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) 104560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{ 105560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint position; 106560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint limit; 107560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint elementSizeShift; 108560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jlong pointer; 109560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 110560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich position = _env->GetIntField(buffer, positionID); 111560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich limit = _env->GetIntField(buffer, limitID); 112560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 113560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich *remaining = (limit - position) << elementSizeShift; 114560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich pointer = _env->CallStaticLongMethod(nioAccessClass, 115560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich getBasePointerID, buffer); 116560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (pointer != 0L) { 117560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich *array = NULL; 11801c26ea89d4bbea3cf550e9328742302dd9a2b25Ashok Bhat return reinterpret_cast<void*>(pointer); 119560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 12024ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes 121560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, 122560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich getBaseArrayID, buffer); 12317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer *offset = _env->CallStaticIntMethod(nioAccessClass, 124560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich getBaseArrayOffsetID, buffer); 12524ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes 12617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer return NULL; 127560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 128560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1293b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass ByteArrayGetter { 1303b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1313b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) { 1323b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi return _env->GetByteArrayElements(array, is_copy); 1333b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1343b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1353b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass BooleanArrayGetter { 1363b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1373b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) { 1383b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi return _env->GetBooleanArrayElements(array, is_copy); 1393b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1403b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1413b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass CharArrayGetter { 1423b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1433b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) { 1443b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi return _env->GetCharArrayElements(array, is_copy); 1453b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1463b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1473b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass ShortArrayGetter { 1483b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1493b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) { 1503b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi return _env->GetShortArrayElements(array, is_copy); 1513b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1523b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1533b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass IntArrayGetter { 1543b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1553b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) { 1563b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi return _env->GetIntArrayElements(array, is_copy); 1573b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1583b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1593b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass LongArrayGetter { 1603b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1613b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) { 1623b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi return _env->GetLongArrayElements(array, is_copy); 1633b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1643b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1653b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass FloatArrayGetter { 1663b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1673b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) { 1683b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi return _env->GetFloatArrayElements(array, is_copy); 1693b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1703b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1713b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass DoubleArrayGetter { 1723b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1733b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) { 1743b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi return _env->GetDoubleArrayElements(array, is_copy); 1753b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1763b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1773b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi 1783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchitemplate<typename JTYPEARRAY, typename ARRAYGETTER> 1793b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchistatic void* 1803b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi YamauchigetArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) { 1813b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi return ARRAYGETTER::Get(_env, array, is_copy); 1823b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi} 1833b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi 1843b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass ByteArrayReleaser { 1853b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1863b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) { 1873b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT); 1883b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1893b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1903b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass BooleanArrayReleaser { 1913b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1923b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) { 1933b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT); 1943b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 1953b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 1963b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass CharArrayReleaser { 1973b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 1983b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) { 1993b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT); 2003b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 2013b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 2023b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass ShortArrayReleaser { 2033b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 2043b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) { 2053b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT); 2063b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 2073b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 2083b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass IntArrayReleaser { 2093b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 2103b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) { 2113b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT); 2123b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 2133b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 2143b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass LongArrayReleaser { 2153b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 2163b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) { 2173b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT); 2183b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 2193b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 2203b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass FloatArrayReleaser { 2213b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 2223b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) { 2233b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT); 2243b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 2253b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 2263b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchiclass DoubleArrayReleaser { 2273b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchipublic: 2283b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) { 2293b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT); 2303b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi } 2313b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi}; 2323b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi 2333b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchitemplate<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER> 2343b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchistatic void 2353b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi YamauchireleaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) { 2363b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi ARRAYRELEASER::Release(_env, array, data, commit); 2373b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi} 2383b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi 239560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 240560814f6b11abe83ff0c4ed18cac015c276b3181Jack PalevichreleasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) 241560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{ 242560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _env->ReleasePrimitiveArrayCritical(array, data, 2432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian commit ? 0 : JNI_ABORT); 244560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 245560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 246560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void * 247560814f6b11abe83ff0c4ed18cac015c276b3181Jack PalevichgetDirectBufferPointer(JNIEnv *_env, jobject buffer) { 248560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich char* buf = (char*) _env->GetDirectBufferAddress(buffer); 249560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (buf) { 250560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint position = _env->GetIntField(buffer, positionID); 251560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 252560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich buf += position << elementSizeShift; 253560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } else { 25424ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes jniThrowException(_env, "java/lang/IllegalArgumentException", 25524ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes "Must use a native order direct Buffer"); 256560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 257560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich return (void*) buf; 258560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 259560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian// -------------------------------------------------------------------------- 2612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 2622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian/* 2632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * returns the number of values glGet returns for a given pname. 2642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * 2652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * The code below is written such that pnames requiring only one values 2662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * are the default (and are not explicitely tested for). This makes the 2672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * checking code much shorter/readable/efficient. 2682ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * 2692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * This means that unknown pnames (e.g.: extensions) will default to 1. If 2702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * that unknown pname needs more than 1 value, then the validation check 2712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian * is incomplete and the app may crash if it passed the wrong number params. 2722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian */ 2732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianstatic int getNeededCount(GLint pname) { 2742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian int needed = 1; 2752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#ifdef GL_ES_VERSION_2_0 2762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian // GLES 2.x pnames 2772ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian switch (pname) { 2782ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_ALIASED_LINE_WIDTH_RANGE: 2792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_ALIASED_POINT_SIZE_RANGE: 2802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian needed = 2; 2812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 2822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 2832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_BLEND_COLOR: 2842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_COLOR_CLEAR_VALUE: 2852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_COLOR_WRITEMASK: 2862ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_SCISSOR_BOX: 2872ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_VIEWPORT: 2882ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian needed = 4; 2892ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 2902ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 2912ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_COMPRESSED_TEXTURE_FORMATS: 2922ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); 2932ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 2942ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 2952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_SHADER_BINARY_FORMATS: 2962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed); 2972ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 2982ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 2992ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#endif 3002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#ifdef GL_VERSION_ES_CM_1_1 3022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian // GLES 1.x pnames 3032ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian switch (pname) { 3042ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_ALIASED_LINE_WIDTH_RANGE: 3052ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_ALIASED_POINT_SIZE_RANGE: 3062ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_DEPTH_RANGE: 3072ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_SMOOTH_LINE_WIDTH_RANGE: 3082ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_SMOOTH_POINT_SIZE_RANGE: 3092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian needed = 2; 3102ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 3112ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3122ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_CURRENT_NORMAL: 3132ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_POINT_DISTANCE_ATTENUATION: 3142ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian needed = 3; 3152ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 3162ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3172ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_COLOR_CLEAR_VALUE: 3182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_COLOR_WRITEMASK: 3192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_CURRENT_COLOR: 3202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_CURRENT_TEXTURE_COORDS: 3212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_FOG_COLOR: 3222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_LIGHT_MODEL_AMBIENT: 3232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_SCISSOR_BOX: 3242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_VIEWPORT: 3252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian needed = 4; 3262ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 3272ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3282ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_MODELVIEW_MATRIX: 3292ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_PROJECTION_MATRIX: 3302ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_TEXTURE_MATRIX: 3312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian needed = 16; 3322ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 3332ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3342ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_COMPRESSED_TEXTURE_FORMATS: 3352ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); 3362ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 3372ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3382ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#endif 3392ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian return needed; 340560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 341560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3423b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchitemplate <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY, 3433b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)> 3442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianstatic void 3452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianget 3462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) { 3472ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 3482ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType; 3492ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage; 3502ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian CTYPE *params_base = (CTYPE *) 0; 3512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _remaining; 3522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian CTYPE *params = (CTYPE *) 0; 3532ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian int _needed = 0; 3542ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3552ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (!params_ref) { 3562ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 3572ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 3582ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "params == null"; 3592ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 3602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (offset < 0) { 3622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 3632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 3642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "offset < 0"; 3652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 3662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _remaining = _env->GetArrayLength(params_ref) - offset; 3682ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = getNeededCount(pname); 3692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian // if we didn't find this pname, we just assume the user passed 3702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian // an array of the right size -- this might happen with extensions 3712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian // or if we forget an enum here. 3722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < _needed) { 3732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 3742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 3752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < needed"; 3762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 3772ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>( 3793b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, params_ref, (jboolean *)0); 3802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian params = params_base + offset; 3812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian GET( 3832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian (GLenum)pname, 3842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian (CTYPE *)params 3852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian ); 3862ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3872ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 3882ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (params_base) { 3893b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>( 3903b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, params_ref, params_base, !_exception); 3912ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3922ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 3932ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 3942ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian} 3962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3972ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 3983b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchitemplate <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY, 3993b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi typename ARRAYRELEASER, void GET(GLenum, CTYPE*)> 4002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianstatic void 4012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopiangetarray 4022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 4032ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 4042ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType; 4052ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage; 4063b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi JTYPEARRAY _array = (JTYPEARRAY) 0; 4072ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _bufferOffset = (jint) 0; 4082ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _remaining; 4092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian CTYPE *params = (CTYPE *) 0; 4102ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian int _needed = 0; 4112ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 4123b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 413cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden _remaining /= sizeof(CTYPE); // convert from bytes to item count 4142ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = getNeededCount(pname); 4152ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian // if we didn't find this pname, we just assume the user passed 4162ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian // an array of the right size -- this might happen with extensions 4172ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian // or if we forget an enum here. 4182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_needed>0 && _remaining < _needed) { 4192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 4202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 4212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < needed"; 4222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 4232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (params == NULL) { 4253b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>( 4263b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, _array, (jboolean *) 0); 4272ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian params = (CTYPE *) (_paramsBase + _bufferOffset); 4282ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4292ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian GET( 4302ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian (GLenum)pname, 4312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian (CTYPE *)params 4322ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian ); 4332ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 4342ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 4352ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_array) { 4363b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>( 4373b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE); 4382ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4392ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 4402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 4412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 442560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 443560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 444560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich// -------------------------------------------------------------------------- 445560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glActiveTexture ( GLenum texture ) */ 446560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 447560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glActiveTexture__I 448560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint texture) { 449560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glActiveTexture( 450560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)texture 451560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 452560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 453560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 454560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glAttachShader ( GLuint program, GLuint shader ) */ 455560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 456560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glAttachShader__II 457560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint shader) { 458560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glAttachShader( 459560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 460560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)shader 461560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 462560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 463560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 464560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBindAttribLocation ( GLuint program, GLuint index, const char *name ) */ 465560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 466560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBindAttribLocation__IILjava_lang_String_2 467560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint index, jstring name) { 4682545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 4692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 4702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 471560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich const char* _nativename = 0; 472560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 473560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!name) { 474428d3fcbe3596b18549cdada9fc68a29f159a946Elliott Hughes _exception = 1; 4752545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 4762545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "name == null"; 477560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 478560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 479560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _nativename = _env->GetStringUTFChars(name, 0); 480560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 481560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glBindAttribLocation( 482560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 483560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index, 484560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (char *)_nativename 485560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 486560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 487560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 488560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_nativename) { 489560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _env->ReleaseStringUTFChars(name, _nativename); 490560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 491560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4922545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 4932545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 4942545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 495560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 496560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 497560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBindBuffer ( GLenum target, GLuint buffer ) */ 498560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 499560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBindBuffer__II 500560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint buffer) { 501560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glBindBuffer( 502560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 503560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)buffer 504560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 505560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 506560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 507560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBindFramebuffer ( GLenum target, GLuint framebuffer ) */ 508560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 509560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBindFramebuffer__II 510560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint framebuffer) { 511560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glBindFramebuffer( 512560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 513560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)framebuffer 514560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 515560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 516560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 517560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBindRenderbuffer ( GLenum target, GLuint renderbuffer ) */ 518560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 519560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBindRenderbuffer__II 520560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint renderbuffer) { 521560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glBindRenderbuffer( 522560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 523560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)renderbuffer 524560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 525560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 526560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 527560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBindTexture ( GLenum target, GLuint texture ) */ 528560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 529560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBindTexture__II 530560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint texture) { 531560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glBindTexture( 532560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 533560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)texture 534560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 535560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 536560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 537560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */ 538560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 539560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBlendColor__FFFF 540560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { 541560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glBlendColor( 542560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)red, 543560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)green, 544560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)blue, 545560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)alpha 546560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 547560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 548560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 549560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBlendEquation ( GLenum mode ) */ 550560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 551560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBlendEquation__I 552560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint mode) { 55373108675c944ab4ee89631dced23566b12341b66Jack Palevich glBlendEquation( 55473108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)mode 55573108675c944ab4ee89631dced23566b12341b66Jack Palevich ); 556560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 557560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 558560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha ) */ 559560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 560560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBlendEquationSeparate__II 561560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint modeRGB, jint modeAlpha) { 56273108675c944ab4ee89631dced23566b12341b66Jack Palevich glBlendEquationSeparate( 56373108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)modeRGB, 56473108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)modeAlpha 56573108675c944ab4ee89631dced23566b12341b66Jack Palevich ); 566560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 567560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 568560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBlendFunc ( GLenum sfactor, GLenum dfactor ) */ 569560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 570560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBlendFunc__II 571560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint sfactor, jint dfactor) { 572560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glBlendFunc( 573560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)sfactor, 574560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)dfactor 575560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 576560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 577560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 578560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBlendFuncSeparate ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */ 579560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 580560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBlendFuncSeparate__IIII 581560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { 58273108675c944ab4ee89631dced23566b12341b66Jack Palevich glBlendFuncSeparate( 58373108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)srcRGB, 58473108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)dstRGB, 58573108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)srcAlpha, 58673108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)dstAlpha 58773108675c944ab4ee89631dced23566b12341b66Jack Palevich ); 588560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 589560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 590560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) */ 591560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 592560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBufferData__IILjava_nio_Buffer_2I 593560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint size, jobject data_buf, jint usage) { 5942545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 5952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 5962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 597560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 59817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 599560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 600560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *data = (GLvoid *) 0; 601560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 602560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (data_buf) { 6033b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 604560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < size) { 6052545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 6062545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 6072545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < size < needed"; 608560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 609560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 610560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 61137c9b49ab5eb5a676370fd7081db0967c38e97a6Thomas Tafertshofer if (data_buf && data == NULL) { 61217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 61317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer data = (GLvoid *) (_dataBase + _bufferOffset); 61417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 615560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glBufferData( 616560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 617560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizeiptr)size, 618560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)data, 619560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)usage 620560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 621560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 622560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 623560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 624560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich releasePointer(_env, _array, data, JNI_FALSE); 625560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 6262545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 6272545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 6282545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 629560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 630560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 631560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) */ 632560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 633560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glBufferSubData__IIILjava_nio_Buffer_2 634560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint offset, jint size, jobject data_buf) { 6352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 6362ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 6372ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 638560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 63917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 640560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 641560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *data = (GLvoid *) 0; 642560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6433b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 644560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < size) { 6452545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 6462545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 6472545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < size < needed"; 648560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 649560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 65017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (data == NULL) { 65117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 65217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer data = (GLvoid *) (_dataBase + _bufferOffset); 65317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 654560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glBufferSubData( 655560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 656560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLintptr)offset, 657560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizeiptr)size, 658560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)data 659560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 660560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 661560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 662560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 663560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich releasePointer(_env, _array, data, JNI_FALSE); 664560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 6652545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 6662545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 6672545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 668560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 669560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 670560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLenum glCheckFramebufferStatus ( GLenum target ) */ 671560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jint 672560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glCheckFramebufferStatus__I 673560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target) { 674560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLenum _returnValue; 675560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glCheckFramebufferStatus( 676560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target 677560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 678cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jint)_returnValue; 679560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 680560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 681560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glClear ( GLbitfield mask ) */ 682560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 683560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glClear__I 684560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint mask) { 685560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glClear( 686560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLbitfield)mask 687560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 688560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 689560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 690560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) */ 691560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 692560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glClearColor__FFFF 693560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jfloat red, jfloat green, jfloat blue, jfloat alpha) { 694560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glClearColor( 695560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)red, 696560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)green, 697560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)blue, 698560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)alpha 699560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 700560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 701560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 702560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glClearDepthf ( GLclampf depth ) */ 703560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 704560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glClearDepthf__F 705560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jfloat depth) { 706560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glClearDepthf( 707560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)depth 708560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 709560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 710560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 711560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glClearStencil ( GLint s ) */ 712560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 713560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glClearStencil__I 714560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint s) { 715560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glClearStencil( 716560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)s 717560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 718560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 719560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 720560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) */ 721560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 722560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glColorMask__ZZZZ 723560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jboolean red, jboolean green, jboolean blue, jboolean alpha) { 724560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glColorMask( 725560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)red, 726560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)green, 727560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)blue, 728560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)alpha 729560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 730560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 731560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 732560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glCompileShader ( GLuint shader ) */ 733560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 734560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glCompileShader__I 735560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shader) { 736560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glCompileShader( 737560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)shader 738560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 739560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 740560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 741560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) */ 742560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 743560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 744560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint imageSize, jobject data_buf) { 745560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 74617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 747560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 748560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *data = (GLvoid *) 0; 749560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 7503b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 75117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (data == NULL) { 75217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 75317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer data = (GLvoid *) (_dataBase + _bufferOffset); 75417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 755560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glCompressedTexImage2D( 756560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 757560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)level, 758560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)internalformat, 759560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 760560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height, 761560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)border, 762560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)imageSize, 763560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)data 764560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 765560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 766560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich releasePointer(_env, _array, data, JNI_FALSE); 767560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 768560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 769560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 770560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) */ 771560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 772560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 773560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint imageSize, jobject data_buf) { 774560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 77517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 776560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 777560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *data = (GLvoid *) 0; 778560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 7793b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 78017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (data == NULL) { 78117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 78217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer data = (GLvoid *) (_dataBase + _bufferOffset); 78317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 784560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glCompressedTexSubImage2D( 785560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 786560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)level, 787560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)xoffset, 788560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)yoffset, 789560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 790560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height, 791560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)format, 792560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)imageSize, 793560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)data 794560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 795560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 796560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich releasePointer(_env, _array, data, JNI_FALSE); 797560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 798560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 799560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 800560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) */ 801560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 802560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glCopyTexImage2D__IIIIIIII 803560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint x, jint y, jint width, jint height, jint border) { 804560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glCopyTexImage2D( 805560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 806560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)level, 807560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)internalformat, 808560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)x, 809560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)y, 810560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 811560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height, 812560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)border 813560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 814560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 815560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 816560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */ 817560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 818560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glCopyTexSubImage2D__IIIIIIII 819560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint x, jint y, jint width, jint height) { 820560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glCopyTexSubImage2D( 821560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 822560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)level, 823560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)xoffset, 824560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)yoffset, 825560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)x, 826560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)y, 827560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 828560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height 829560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 830560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 831560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 832560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLuint glCreateProgram ( void ) */ 833560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jint 834560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glCreateProgram__ 835560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this) { 836560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint _returnValue; 837560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glCreateProgram(); 838cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jint)_returnValue; 839560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 840560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 841560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLuint glCreateShader ( GLenum type ) */ 842560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jint 843560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glCreateShader__I 844560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint type) { 845560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint _returnValue; 846560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glCreateShader( 847560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)type 848560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 849cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jint)_returnValue; 850560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 851560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 852560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glCullFace ( GLenum mode ) */ 853560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 854560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glCullFace__I 855560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint mode) { 856560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glCullFace( 857560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)mode 858560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 859560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 860560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 861560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ 862560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 863560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteBuffers__I_3II 864560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { 8652545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 8662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 8672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 868560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *buffers_base = (GLuint *) 0; 869560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 870560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *buffers = (GLuint *) 0; 871560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 872560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!buffers_ref) { 8732545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 8742545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 8752545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "buffers == null"; 876560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 877560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 878560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 8792545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 8802545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 8812545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 882560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 883560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 884560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(buffers_ref) - offset; 885560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < n) { 8862545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 8872545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 8882545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "length - offset < n < needed"; 889560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 890560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 891560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich buffers_base = (GLuint *) 8923b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(buffers_ref, (jboolean *)0); 893560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich buffers = buffers_base + offset; 894560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 895560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteBuffers( 896560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 897560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)buffers 898560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 899560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 900560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 901560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (buffers_base) { 9023b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, 903560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 904560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 9052545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 9062545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 9072545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 908560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 909560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 910560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) */ 911560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 912560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteBuffers__ILjava_nio_IntBuffer_2 913560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { 9142545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 9152ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 9162ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 9173b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 91817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 919560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 920560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *buffers = (GLuint *) 0; 921560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 9223b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 923560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < n) { 9242545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 9252545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 9262545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < n < needed"; 927560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 928560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 92917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (buffers == NULL) { 9303b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 93117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer buffers = (GLuint *) (_buffersBase + _bufferOffset); 93217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 933560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteBuffers( 934560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 935560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)buffers 936560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 937560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 938560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 939560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 9403b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)buffers, JNI_ABORT); 941560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 9422545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 9432545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 9442545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 945560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 946560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 947560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) */ 948560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 949560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteFramebuffers__I_3II 950560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { 9512545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 9522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 9532ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 954560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *framebuffers_base = (GLuint *) 0; 955560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 956560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *framebuffers = (GLuint *) 0; 957560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 958560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!framebuffers_ref) { 9592545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 9602545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 9612545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "framebuffers == null"; 962560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 963560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 964560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 9652545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 9662545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 9672545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 968560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 969560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 970560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(framebuffers_ref) - offset; 9712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < n) { 9722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 9732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 9742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < n < needed"; 9752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 9762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 977560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich framebuffers_base = (GLuint *) 9783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); 979560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich framebuffers = framebuffers_base + offset; 980560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 981560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteFramebuffers( 982560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 983560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)framebuffers 984560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 985560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 986560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 987560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (framebuffers_base) { 9883b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, 989560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 990560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 9912545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 9922545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 9932545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 994560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 995560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 996560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) */ 997560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 998560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteFramebuffers__ILjava_nio_IntBuffer_2 999560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { 10002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 10012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 10022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 10033b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 100417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 1005560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1006560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *framebuffers = (GLuint *) 0; 1007560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 10083b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 10092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < n) { 10102ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 10112ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 10122ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < n < needed"; 10132ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 10142ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 101517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (framebuffers == NULL) { 10163b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 101717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); 101817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 1019560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteFramebuffers( 1020560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1021560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)framebuffers 1022560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 10232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 10242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 1025560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 10263b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, JNI_ABORT); 1027560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 10282ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 10292ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 10302ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 1031560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1032560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1033560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteProgram ( GLuint program ) */ 1034560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1035560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteProgram__I 1036560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program) { 1037560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteProgram( 1038560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program 1039560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1040560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1041560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1042560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) */ 1043560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1044560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteRenderbuffers__I_3II 1045560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { 10462545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 10472ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 10482ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 1049560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *renderbuffers_base = (GLuint *) 0; 1050560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1051560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *renderbuffers = (GLuint *) 0; 1052560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1053560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!renderbuffers_ref) { 10542545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 10552545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 10562545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "renderbuffers == null"; 1057560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1058560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1059560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 10602545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 10612545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 10622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 1063560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1064560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1065560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; 10662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < n) { 10672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 10682ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 10692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < n < needed"; 10702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 10712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 1072560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich renderbuffers_base = (GLuint *) 10733b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); 1074560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich renderbuffers = renderbuffers_base + offset; 1075560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1076560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteRenderbuffers( 1077560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1078560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)renderbuffers 1079560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1080560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1081560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1082560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (renderbuffers_base) { 10833b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, 1084560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 1085560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 10862545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 10872545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 10882545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1089560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1090560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1091560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) */ 1092560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1093560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2 1094560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { 10952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 10962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 10972ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 10983b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 109917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 1100560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1101560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *renderbuffers = (GLuint *) 0; 1102560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 11033b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 11042ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < n) { 11052ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 11062ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 11072ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < n < needed"; 11082ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 11092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 111017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (renderbuffers == NULL) { 11113b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 111217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); 111317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 1114560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteRenderbuffers( 1115560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1116560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)renderbuffers 1117560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 11182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 11192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 1120560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 11213b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, JNI_ABORT); 1122560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 11232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 11242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 11252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 1126560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1127560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1128560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteShader ( GLuint shader ) */ 1129560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1130560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteShader__I 1131560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shader) { 1132560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteShader( 1133560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)shader 1134560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1135560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1136560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1137560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ 1138560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1139560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteTextures__I_3II 1140560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { 11412545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 11422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 11432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 1144560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *textures_base = (GLuint *) 0; 1145560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1146560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *textures = (GLuint *) 0; 1147560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1148560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!textures_ref) { 11492545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 11502545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 11512545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "textures == null"; 1152560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1153560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1154560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 11552545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 11562545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 11572545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 1158560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1159560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1160560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(textures_ref) - offset; 1161560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < n) { 11622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 11632545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 11642545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "length - offset < n < needed"; 1165560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1166560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1167560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich textures_base = (GLuint *) 11683b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(textures_ref, (jboolean *)0); 1169560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich textures = textures_base + offset; 1170560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1171560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteTextures( 1172560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1173560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)textures 1174560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1175560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1176560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1177560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (textures_base) { 11783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, 1179560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 1180560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 11812545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 11822545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 11832545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1184560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1185560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1186560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDeleteTextures ( GLsizei n, const GLuint *textures ) */ 1187560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1188560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDeleteTextures__ILjava_nio_IntBuffer_2 1189560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { 11902545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 11912ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 11922ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 11933b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 119417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 1195560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1196560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *textures = (GLuint *) 0; 1197560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 11983b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1199560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < n) { 12002545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 12012545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 12022545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < n < needed"; 1203560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1204560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 120517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (textures == NULL) { 12063b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 120717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer textures = (GLuint *) (_texturesBase + _bufferOffset); 120817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 1209560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDeleteTextures( 1210560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1211560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)textures 1212560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1213560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1214560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1215560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 12163b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)textures, JNI_ABORT); 1217560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 12182545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 12192545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 12202545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1221560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1222560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1223560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDepthFunc ( GLenum func ) */ 1224560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1225560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDepthFunc__I 1226560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint func) { 1227560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDepthFunc( 1228560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)func 1229560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1230560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1231560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1232560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDepthMask ( GLboolean flag ) */ 1233560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1234560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDepthMask__Z 1235560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jboolean flag) { 1236560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDepthMask( 1237560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)flag 1238560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1239560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1240560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1241560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDepthRangef ( GLclampf zNear, GLclampf zFar ) */ 1242560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1243560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDepthRangef__FF 1244560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jfloat zNear, jfloat zFar) { 1245560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDepthRangef( 1246560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)zNear, 1247560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)zFar 1248560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1249560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1250560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1251560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDetachShader ( GLuint program, GLuint shader ) */ 1252560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1253560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDetachShader__II 1254560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint shader) { 1255560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDetachShader( 1256560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 1257560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)shader 1258560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1259560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1260560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1261560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDisable ( GLenum cap ) */ 1262560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1263560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDisable__I 1264560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint cap) { 1265560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDisable( 1266560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)cap 1267560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1268560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1269560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1270560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDisableVertexAttribArray ( GLuint index ) */ 1271560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1272560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDisableVertexAttribArray__I 1273560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint index) { 1274560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDisableVertexAttribArray( 1275560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index 1276560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1277560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1278560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1279560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) */ 1280560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1281560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDrawArrays__III 1282560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint mode, jint first, jint count) { 1283560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDrawArrays( 1284560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)mode, 1285560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)first, 1286560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count 1287560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1288560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1289560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1290224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) */ 1291224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevichstatic void 1292224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevichandroid_glDrawElements__IIII 1293224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint offset) { 12942545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 12952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 12962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 1297224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich glDrawElements( 1298224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (GLenum)mode, 1299224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (GLsizei)count, 1300224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (GLenum)type, 130101c26ea89d4bbea3cf550e9328742302dd9a2b25Ashok Bhat reinterpret_cast<GLvoid *>(offset) 1302224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich ); 13032545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 13042545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 13052545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1306224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich} 1307224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich 1308560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) */ 1309560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1310560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glDrawElements__IIILjava_nio_Buffer_2 1311560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf) { 13122545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 13132ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 13142ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 1315560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 131617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 1317560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1318560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *indices = (GLvoid *) 0; 1319560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 13203b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1321560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < count) { 13222545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 13232545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/ArrayIndexOutOfBoundsException"; 13242545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < count < needed"; 1325560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1326560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 132717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (indices == NULL) { 132817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 132917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer indices = (GLvoid *) (_indicesBase + _bufferOffset); 133017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 1331560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glDrawElements( 1332560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)mode, 1333560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 1334560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)type, 1335560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)indices 1336560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1337560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1338560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1339560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 1340560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich releasePointer(_env, _array, indices, JNI_FALSE); 1341560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 13422545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 13432545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 13442545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1345560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1346560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1347560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glEnable ( GLenum cap ) */ 1348560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1349560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glEnable__I 1350560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint cap) { 1351560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glEnable( 1352560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)cap 1353560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1354560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1355560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1356560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glEnableVertexAttribArray ( GLuint index ) */ 1357560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1358560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glEnableVertexAttribArray__I 1359560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint index) { 1360560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glEnableVertexAttribArray( 1361560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index 1362560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1363560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1364560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1365560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glFinish ( void ) */ 1366560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1367560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glFinish__ 1368560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this) { 1369560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glFinish(); 1370560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1371560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1372560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glFlush ( void ) */ 1373560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1374560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glFlush__ 1375560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this) { 1376560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glFlush(); 1377560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1378560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1379560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glFramebufferRenderbuffer ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) */ 1380560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1381560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glFramebufferRenderbuffer__IIII 1382560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint attachment, jint renderbuffertarget, jint renderbuffer) { 1383560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glFramebufferRenderbuffer( 1384560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 1385560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)attachment, 1386560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)renderbuffertarget, 1387560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)renderbuffer 1388560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1389560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1390560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1391560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glFramebufferTexture2D ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) */ 1392560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1393560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glFramebufferTexture2D__IIIII 1394560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint attachment, jint textarget, jint texture, jint level) { 1395560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glFramebufferTexture2D( 1396560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 1397560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)attachment, 1398560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)textarget, 1399560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)texture, 1400560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)level 1401560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1402560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1403560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1404560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glFrontFace ( GLenum mode ) */ 1405560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1406560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glFrontFace__I 1407560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint mode) { 1408560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glFrontFace( 1409560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)mode 1410560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1411560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1412560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1413560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ 1414560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1415560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGenBuffers__I_3II 1416560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jintArray buffers_ref, jint offset) { 1417560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 14182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 14192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 1420560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *buffers_base = (GLuint *) 0; 1421560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1422560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *buffers = (GLuint *) 0; 1423560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1424560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!buffers_ref) { 1425560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 14262545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 14272545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "buffers == null"; 1428560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1429560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1430560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 1431560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 14322545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 14332545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 1434560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1435560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1436560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(buffers_ref) - offset; 1437560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < n) { 1438560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 14392545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 14402545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "length - offset < n < needed"; 1441560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1442560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1443560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich buffers_base = (GLuint *) 14443b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(buffers_ref, (jboolean *)0); 1445560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich buffers = buffers_base + offset; 1446560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1447560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGenBuffers( 1448560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1449560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)buffers 1450560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1451560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1452560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1453560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (buffers_base) { 14543b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(buffers_ref, (jint*)buffers_base, 1455560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 1456560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 14572545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 14582545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 14592545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1460560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1461560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1462560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGenBuffers ( GLsizei n, GLuint *buffers ) */ 1463560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1464560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGenBuffers__ILjava_nio_IntBuffer_2 1465560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jobject buffers_buf) { 1466560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 14672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 14682ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 14693b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 147017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 1471560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1472560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *buffers = (GLuint *) 0; 1473560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 14743b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi buffers = (GLuint *)getPointer(_env, buffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1475560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < n) { 1476560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 14772545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 14782545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < n < needed"; 1479560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1480560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 148117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (buffers == NULL) { 14823b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _buffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 148317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer buffers = (GLuint *) (_buffersBase + _bufferOffset); 148417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 1485560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGenBuffers( 1486560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1487560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)buffers 1488560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1489560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1490560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1491560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 14923b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)buffers, _exception ? JNI_ABORT : 0); 1493560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 14942545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 14952545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 14962545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1497560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1498560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1499560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGenerateMipmap ( GLenum target ) */ 1500560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1501560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGenerateMipmap__I 1502560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target) { 1503560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGenerateMipmap( 1504560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target 1505560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1506560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1507560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1508560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) */ 1509560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1510560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGenFramebuffers__I_3II 1511560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jintArray framebuffers_ref, jint offset) { 1512560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 15132ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 15142ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 1515560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *framebuffers_base = (GLuint *) 0; 1516560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1517560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *framebuffers = (GLuint *) 0; 1518560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1519560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!framebuffers_ref) { 1520560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 15212545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 15222545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "framebuffers == null"; 1523560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1524560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1525560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 1526560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 15272545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 15282545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 1529560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1530560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1531560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(framebuffers_ref) - offset; 15322ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < n) { 15332ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 15342ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 15352ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < n < needed"; 15362ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 15372ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 1538560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich framebuffers_base = (GLuint *) 15393b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(framebuffers_ref, (jboolean *)0); 1540560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich framebuffers = framebuffers_base + offset; 1541560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1542560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGenFramebuffers( 1543560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1544560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)framebuffers 1545560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1546560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1547560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1548560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (framebuffers_base) { 15493b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(framebuffers_ref, (jint*)framebuffers_base, 1550560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 1551560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 15522545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 15532545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 15542545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1555560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1556560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1557560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) */ 1558560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1559560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGenFramebuffers__ILjava_nio_IntBuffer_2 1560560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jobject framebuffers_buf) { 15612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 15622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 15632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 15643b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 156517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 1566560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1567560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *framebuffers = (GLuint *) 0; 1568560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 15693b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi framebuffers = (GLuint *)getPointer(_env, framebuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 15702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < n) { 15712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 15722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 15732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < n < needed"; 15742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 15752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 157617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (framebuffers == NULL) { 15773b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _framebuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 157817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer framebuffers = (GLuint *) (_framebuffersBase + _bufferOffset); 157917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 1580560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGenFramebuffers( 1581560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1582560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)framebuffers 1583560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 15842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 15852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 1586560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 15873b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)framebuffers, _exception ? JNI_ABORT : 0); 15882ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 15892ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 15902ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 1591560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1592560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1593560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1594560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) */ 1595560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1596560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGenRenderbuffers__I_3II 1597560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jintArray renderbuffers_ref, jint offset) { 1598560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 15992ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 16002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 1601560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *renderbuffers_base = (GLuint *) 0; 1602560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1603560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *renderbuffers = (GLuint *) 0; 1604560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1605560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!renderbuffers_ref) { 1606560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 16072545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 16082545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "renderbuffers == null"; 1609560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1610560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1611560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 1612560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 16132545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 16142545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 1615560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1616560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1617560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(renderbuffers_ref) - offset; 16182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < n) { 16192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 16202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 16212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < n < needed"; 16222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 16232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 1624560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich renderbuffers_base = (GLuint *) 16253b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(renderbuffers_ref, (jboolean *)0); 1626560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich renderbuffers = renderbuffers_base + offset; 1627560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1628560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGenRenderbuffers( 1629560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1630560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)renderbuffers 1631560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1632560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1633560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1634560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (renderbuffers_base) { 16353b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(renderbuffers_ref, (jint*)renderbuffers_base, 1636560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 1637560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 16382545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 16392545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 16402545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1641560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1642560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1643560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) */ 1644560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1645560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGenRenderbuffers__ILjava_nio_IntBuffer_2 1646560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jobject renderbuffers_buf) { 16472ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 16482ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 16492ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 16503b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 165117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 1652560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1653560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *renderbuffers = (GLuint *) 0; 1654560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 16553b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi renderbuffers = (GLuint *)getPointer(_env, renderbuffers_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 16562ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < n) { 16572ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 16582ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 16592ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < n < needed"; 16602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 16612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 166217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (renderbuffers == NULL) { 16633b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _renderbuffersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 166417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer renderbuffers = (GLuint *) (_renderbuffersBase + _bufferOffset); 166517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 1666560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGenRenderbuffers( 1667560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1668560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)renderbuffers 1669560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 16702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 16712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 1672560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 16733b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)renderbuffers, _exception ? JNI_ABORT : 0); 16742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 16752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 16762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 1677560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1678560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1679560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1680560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGenTextures ( GLsizei n, GLuint *textures ) */ 1681560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1682560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGenTextures__I_3II 1683560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jintArray textures_ref, jint offset) { 1684560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 16852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 16862ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 1687560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *textures_base = (GLuint *) 0; 1688560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1689560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *textures = (GLuint *) 0; 1690560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1691560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!textures_ref) { 1692560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 16932545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 16942545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "textures == null"; 1695560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1696560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1697560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 1698560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 16992545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 17002545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 1701560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1702560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1703560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(textures_ref) - offset; 1704560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < n) { 1705560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 17062545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 17072545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "length - offset < n < needed"; 1708560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1709560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1710560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich textures_base = (GLuint *) 17113b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(textures_ref, (jboolean *)0); 1712560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich textures = textures_base + offset; 1713560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1714560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGenTextures( 1715560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1716560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)textures 1717560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1718560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1719560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1720560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (textures_base) { 17213b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(textures_ref, (jint*)textures_base, 1722560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 1723560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 17242545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 17252545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 17262545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1727560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1728560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1729560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGenTextures ( GLsizei n, GLuint *textures ) */ 1730560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1731560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGenTextures__ILjava_nio_IntBuffer_2 1732560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jobject textures_buf) { 1733560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 17342ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 17352ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 17363b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 173717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 1738560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 1739560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *textures = (GLuint *) 0; 1740560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 17413b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi textures = (GLuint *)getPointer(_env, textures_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 1742560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < n) { 1743560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 17442545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 17452545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < n < needed"; 1746560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1747560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 174817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (textures == NULL) { 17493b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _texturesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 175017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer textures = (GLuint *) (_texturesBase + _bufferOffset); 175117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 1752560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGenTextures( 1753560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 1754560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)textures 1755560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1756560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1757560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1758560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 17593b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)textures, _exception ? JNI_ABORT : 0); 1760560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 17612545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 17622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 17632545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1764560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1765560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1766560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 1767560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1768560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetActiveAttrib__III_3II_3II_3II_3BI 1769560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) { 1770560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 17712545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer const char * _exceptionType; 17722545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer const char * _exceptionMessage; 1773560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *length_base = (GLsizei *) 0; 1774560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _lengthRemaining; 1775560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *length = (GLsizei *) 0; 1776560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *size_base = (GLint *) 0; 1777560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _sizeRemaining; 1778560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *size = (GLint *) 0; 1779560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLenum *type_base = (GLenum *) 0; 1780560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _typeRemaining; 1781560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLenum *type = (GLenum *) 0; 1782560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich char *name_base = (char *) 0; 1783560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _nameRemaining; 1784560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich char *name = (char *) 0; 1785560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 17866aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (length_ref) { 17876aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (lengthOffset < 0) { 17886aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exception = 1; 17896aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionType = "java/lang/IllegalArgumentException"; 17906aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionMessage = "lengthOffset < 0"; 17916aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos goto exit; 17926aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos } 17936aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; 17946aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos length_base = (GLsizei *) 17956aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _env->GetIntArrayElements(length_ref, (jboolean *)0); 17966aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos length = length_base + lengthOffset; 1797560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1798560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1799560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!size_ref) { 1800560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 18012545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 18022545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "size == null"; 1803560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1804560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1805560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (sizeOffset < 0) { 1806560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 18072545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 18082545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "sizeOffset < 0"; 1809560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1810560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1811560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; 1812560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich size_base = (GLint *) 18133b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(size_ref, (jboolean *)0); 1814560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich size = size_base + sizeOffset; 1815560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1816560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!type_ref) { 1817560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 18182545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 18192545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "type == null"; 1820560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1821560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1822560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (typeOffset < 0) { 1823560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 18242545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 18252545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "typeOffset < 0"; 1826560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1827560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1828560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; 1829560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich type_base = (GLenum *) 18303b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(type_ref, (jboolean *)0); 1831560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich type = type_base + typeOffset; 1832560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1833560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!name_ref) { 1834560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 18352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 18362545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "name == null"; 1837560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1838560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1839560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (nameOffset < 0) { 1840560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 18412545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 18422545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "nameOffset < 0"; 1843560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 1844560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1845560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; 1846560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich name_base = (char *) 18473b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetByteArrayElements(name_ref, (jboolean *)0); 1848560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich name = name_base + nameOffset; 1849560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1850560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetActiveAttrib( 1851560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 1852560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index, 1853560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)bufsize, 1854560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei *)length, 1855560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)size, 1856560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum *)type, 1857560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (char *)name 1858560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 1859560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1860560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 1861560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (name_base) { 18623b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseByteArrayElements(name_ref, (jbyte*)name_base, 1863560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 1864560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1865560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (type_base) { 18663b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(type_ref, (jint*)type_base, 1867560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 1868560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1869560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (size_base) { 18703b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(size_ref, (jint*)size_base, 1871560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 1872560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1873560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (length_base) { 18743b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(length_ref, (jint*)length_base, 1875560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 1876560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 18772545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 18782545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 18792545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 1880560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1881560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1882560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 1883560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 1884560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B 1885560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) { 18863b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _lengthArray = (jintArray) 0; 188717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _lengthBufferOffset = (jint) 0; 18883b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _sizeArray = (jintArray) 0; 188917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _sizeBufferOffset = (jint) 0; 18903b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _typeArray = (jintArray) 0; 189117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _typeBufferOffset = (jint) 0; 1892560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _lengthRemaining; 1893560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *length = (GLsizei *) 0; 1894560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _sizeRemaining; 1895560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *size = (GLint *) 0; 1896560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _typeRemaining; 1897560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLenum *type = (GLenum *) 0; 1898560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 18993b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset); 19003b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset); 19013b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset); 190217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (length == NULL) { 19033b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0); 190417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer length = (GLsizei *) (_lengthBase + _lengthBufferOffset); 190517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 190617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (size == NULL) { 19073b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0); 190817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer size = (GLint *) (_sizeBase + _sizeBufferOffset); 190917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 191017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (type == NULL) { 19113b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0); 191217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer type = (GLenum *) (_typeBase + _typeBufferOffset); 191317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 1914560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetActiveAttrib( 1915560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 1916560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index, 1917560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)bufsize, 1918560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei *)length, 1919560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)size, 1920560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum *)type, 192101c26ea89d4bbea3cf550e9328742302dd9a2b25Ashok Bhat reinterpret_cast<char *>(name) 1922560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 192317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (_typeArray) { 19243b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE); 1925560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1926560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_sizeArray) { 19273b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE); 1928560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 192917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (_lengthArray) { 19303b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE); 1931560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 1932560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 1933560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 1934dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 1935dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferstatic jstring 1936dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferandroid_glGetActiveAttrib1 1937dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) { 1938dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _exception = 0; 1939dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer const char * _exceptionType; 1940dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer const char * _exceptionMessage; 1941dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint *size_base = (GLint *) 0; 1942dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _sizeRemaining; 1943dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint *size = (GLint *) 0; 1944dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLenum *type_base = (GLenum *) 0; 1945dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _typeRemaining; 1946dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLenum *type = (GLenum *) 0; 1947dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 1948dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jstring result = 0; 1949dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 1950dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint len = 0; 1951dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len); 1952dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (!len) { 1953dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return _env->NewStringUTF(""); 1954dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 1955dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer char* buf = (char*) malloc(len); 1956dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 1957dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (buf == NULL) { 1958dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 1959dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return NULL; 1960dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 1961dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (!size_ref) { 1962dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception = 1; 1963dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 1964dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionMessage = "size == null"; 1965dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer goto exit; 1966dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 1967dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (sizeOffset < 0) { 1968dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception = 1; 1969dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 1970dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionMessage = "sizeOffset < 0"; 1971dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer goto exit; 1972dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 1973dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; 1974dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer size_base = (GLint *) 19753b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(size_ref, (jboolean *)0); 1976dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer size = size_base + sizeOffset; 1977dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 1978dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (!type_ref) { 1979dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception = 1; 1980dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 1981dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionMessage = "type == null"; 1982dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer goto exit; 1983dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 1984dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (typeOffset < 0) { 1985dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception = 1; 1986dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 1987dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionMessage = "typeOffset < 0"; 1988dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer goto exit; 1989dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 1990dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; 1991dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer type_base = (GLenum *) 19923b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(type_ref, (jboolean *)0); 1993dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer type = type_base + typeOffset; 1994dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 1995dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetActiveAttrib( 1996dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLuint)program, 1997dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLuint)index, 1998dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLsizei)len, 1999dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer NULL, 2000dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLint *)size, 2001dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLenum *)type, 2002dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (char *)buf 2003dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer ); 2004dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferexit: 2005dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (type_base) { 20063b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(type_ref, (jint*)type_base, 2007dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception ? JNI_ABORT: 0); 2008dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2009dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (size_base) { 20103b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(size_ref, (jint*)size_base, 2011dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception ? JNI_ABORT: 0); 2012dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2013dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (_exception != 1) { 2014dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer result = _env->NewStringUTF(buf); 2015dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2016dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (buf) { 2017dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer free(buf); 2018dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2019dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (_exception) { 2020dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 2021dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2022dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (result == 0) { 2023dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer result = _env->NewStringUTF(""); 2024dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2025dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2026dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return result; 2027dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer} 2028dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2029dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer/* void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2030dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferstatic jstring 2031dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferandroid_glGetActiveAttrib2 2032dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) { 20333b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _sizeArray = (jintArray) 0; 2034dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _sizeBufferOffset = (jint) 0; 20353b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _typeArray = (jintArray) 0; 2036dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _typeBufferOffset = (jint) 0; 2037dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _lengthRemaining; 2038dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLsizei *length = (GLsizei *) 0; 2039dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _sizeRemaining; 2040dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint *size = (GLint *) 0; 2041dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _typeRemaining; 2042dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLenum *type = (GLenum *) 0; 2043dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2044dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jstring result = 0; 2045dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2046dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint len = 0; 2047dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len); 2048dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (!len) { 2049dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return _env->NewStringUTF(""); 2050dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2051dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer char* buf = (char*) malloc(len); 2052dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2053dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (buf == NULL) { 2054dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 2055dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return NULL; 2056dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2057dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 20583b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset); 20593b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset); 2060dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (size == NULL) { 20613b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0); 2062dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer size = (GLint *) (_sizeBase + _sizeBufferOffset); 2063dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2064dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (type == NULL) { 20653b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0); 2066dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer type = (GLenum *) (_typeBase + _typeBufferOffset); 2067dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2068dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetActiveAttrib( 2069dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLuint)program, 2070dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLuint)index, 2071dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLsizei)len, 2072dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer NULL, 2073dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLint *)size, 2074dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLenum *)type, 2075dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (char *)buf 2076dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer ); 2077dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2078dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (_typeArray) { 20793b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE); 2080dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2081dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (_sizeArray) { 20823b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE); 2083dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2084dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer result = _env->NewStringUTF(buf); 2085dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (buf) { 2086dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer free(buf); 2087dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2088dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return result; 2089dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer} 2090560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2091560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2092560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetActiveUniform__III_3II_3II_3II_3BI 2093560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) { 2094560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 20952545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer const char * _exceptionType; 20962545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer const char * _exceptionMessage; 2097560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *length_base = (GLsizei *) 0; 2098560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _lengthRemaining; 2099560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *length = (GLsizei *) 0; 2100560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *size_base = (GLint *) 0; 2101560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _sizeRemaining; 2102560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *size = (GLint *) 0; 2103560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLenum *type_base = (GLenum *) 0; 2104560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _typeRemaining; 2105560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLenum *type = (GLenum *) 0; 2106560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich char *name_base = (char *) 0; 2107560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _nameRemaining; 2108560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich char *name = (char *) 0; 2109560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 21106aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (length_ref) { 21116aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (lengthOffset < 0) { 21126aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exception = 1; 21136aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionType = "java/lang/IllegalArgumentException"; 21146aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionMessage = "lengthOffset < 0"; 21156aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos goto exit; 21166aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos } 21176aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; 21186aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos length_base = (GLsizei *) 21196aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _env->GetIntArrayElements(length_ref, (jboolean *)0); 21206aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos length = length_base + lengthOffset; 2121560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2122560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2123560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!size_ref) { 2124560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 21252545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 21262545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "size == null"; 2127560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2128560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2129560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (sizeOffset < 0) { 2130560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 21312545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 21322545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "sizeOffset < 0"; 2133560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2134560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2135560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; 2136560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich size_base = (GLint *) 21373b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(size_ref, (jboolean *)0); 2138560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich size = size_base + sizeOffset; 2139560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2140560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!type_ref) { 2141560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 21422545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 21432545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "type == null"; 2144560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2145560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2146560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (typeOffset < 0) { 2147560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 21482545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 21492545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "typeOffset < 0"; 2150560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2151560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2152560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; 2153560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich type_base = (GLenum *) 21543b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(type_ref, (jboolean *)0); 2155560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich type = type_base + typeOffset; 2156560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2157560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!name_ref) { 2158560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 21592545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 21602545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "name == null"; 2161560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2162560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2163560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (nameOffset < 0) { 2164560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 21652545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 21662545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "nameOffset < 0"; 2167560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2168560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2169560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; 2170560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich name_base = (char *) 21713b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetByteArrayElements(name_ref, (jboolean *)0); 2172560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich name = name_base + nameOffset; 2173560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2174560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetActiveUniform( 2175560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 2176560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index, 2177560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)bufsize, 2178560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei *)length, 2179560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)size, 2180560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum *)type, 2181560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (char *)name 2182560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 2183560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2184560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 2185560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (name_base) { 21863b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseByteArrayElements(name_ref, (jbyte*)name_base, 2187560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 2188560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2189560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (type_base) { 21903b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(type_ref, (jint*)type_base, 2191560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 2192560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2193560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (size_base) { 21943b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(size_ref, (jint*)size_base, 2195560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 2196560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2197560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (length_base) { 21983b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(length_ref, (jint*)length_base, 2199560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 2200560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 22012545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 22022545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 22032545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 2204560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2205560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2206560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2207560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2208560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B 2209560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) { 22103b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _lengthArray = (jintArray) 0; 221117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _lengthBufferOffset = (jint) 0; 22123b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _sizeArray = (jintArray) 0; 221317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _sizeBufferOffset = (jint) 0; 22143b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _typeArray = (jintArray) 0; 221517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _typeBufferOffset = (jint) 0; 2216560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _lengthRemaining; 2217560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *length = (GLsizei *) 0; 2218560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _sizeRemaining; 2219560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *size = (GLint *) 0; 2220560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _typeRemaining; 2221560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLenum *type = (GLenum *) 0; 2222560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 22233b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset); 22243b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset); 22253b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset); 222617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (length == NULL) { 22273b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0); 222817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer length = (GLsizei *) (_lengthBase + _lengthBufferOffset); 222917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 223017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (size == NULL) { 22313b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0); 223217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer size = (GLint *) (_sizeBase + _sizeBufferOffset); 223317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 223417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (type == NULL) { 22353b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0); 223617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer type = (GLenum *) (_typeBase + _typeBufferOffset); 223717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 2238560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetActiveUniform( 2239560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 2240560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index, 2241560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)bufsize, 2242560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei *)length, 2243560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)size, 2244560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum *)type, 224501c26ea89d4bbea3cf550e9328742302dd9a2b25Ashok Bhat reinterpret_cast<char *>(name) 2246560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 224717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (_typeArray) { 22483b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE); 2249560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2250560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_sizeArray) { 22513b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE); 2252560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 225317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (_lengthArray) { 22543b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE); 2255560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2256560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2257560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2258dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2259dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferstatic jstring 2260dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferandroid_glGetActiveUniform1 2261dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) { 2262dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _exception = 0; 2263dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer const char * _exceptionType; 2264dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer const char * _exceptionMessage; 2265dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2266dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint *size_base = (GLint *) 0; 2267dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _sizeRemaining; 2268dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint *size = (GLint *) 0; 2269dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2270dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLenum *type_base = (GLenum *) 0; 2271dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _typeRemaining; 2272dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLenum *type = (GLenum *) 0; 2273dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2274dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jstring result = 0; 2275dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2276dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint len = 0; 2277dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetProgramiv((GLuint)program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &len); 2278dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (!len) { 2279dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return _env->NewStringUTF(""); 2280dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2281dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer char* buf = (char*) malloc(len); 2282dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2283dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (buf == NULL) { 2284dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 2285dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return NULL; 2286dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2287dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2288dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (!size_ref) { 2289dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception = 1; 2290dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 2291dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionMessage = "size == null"; 2292dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer goto exit; 2293dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2294dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (sizeOffset < 0) { 2295dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception = 1; 2296dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 2297dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionMessage = "sizeOffset < 0"; 2298dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer goto exit; 2299dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2300dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; 2301dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer size_base = (GLint *) 23023b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(size_ref, (jboolean *)0); 2303dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer size = size_base + sizeOffset; 2304dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2305dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (!type_ref) { 2306dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception = 1; 2307dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 2308dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionMessage = "type == null"; 2309dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer goto exit; 2310dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2311dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (typeOffset < 0) { 2312dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception = 1; 2313dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 2314dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exceptionMessage = "typeOffset < 0"; 2315dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer goto exit; 2316dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2317dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; 2318dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer type_base = (GLenum *) 23193b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(type_ref, (jboolean *)0); 2320dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer type = type_base + typeOffset; 2321dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2322dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetActiveUniform( 2323dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLuint)program, 2324dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLuint)index, 2325dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLsizei)len, 2326dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer NULL, 2327dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLint *)size, 2328dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLenum *)type, 2329dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (char *)buf 2330dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer ); 2331dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2332dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferexit: 2333dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (type_base) { 23343b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(type_ref, (jint*)type_base, 2335dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception ? JNI_ABORT: 0); 2336dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2337dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (size_base) { 23383b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(size_ref, (jint*)size_base, 2339dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer _exception ? JNI_ABORT: 0); 2340dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2341dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (_exception != 1) { 2342dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer result = _env->NewStringUTF(buf); 2343dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2344dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (buf) { 2345dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer free(buf); 2346dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2347dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (_exception) { 2348dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 2349dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2350dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (result == 0) { 2351dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer result = _env->NewStringUTF(""); 2352dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2353dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return result; 2354dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer} 2355dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2356dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer/* void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) */ 2357dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferstatic jstring 2358dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferandroid_glGetActiveUniform2 2359dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) { 23603b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _sizeArray = (jintArray) 0; 2361dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _sizeBufferOffset = (jint) 0; 23623b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _typeArray = (jintArray) 0; 2363dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _typeBufferOffset = (jint) 0; 2364dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _sizeRemaining; 2365dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint *size = (GLint *) 0; 2366dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jint _typeRemaining; 2367dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLenum *type = (GLenum *) 0; 2368dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2369dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jstring result = 0; 2370dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint len = 0; 2371dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetProgramiv((GLuint)program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &len); 2372dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (!len) { 2373dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return _env->NewStringUTF(""); 2374dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2375dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer char* buf = (char*) malloc(len); 2376dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2377dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (buf == NULL) { 2378dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 2379dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return NULL; 2380dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2381dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 23823b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset); 23833b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset); 2384dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2385dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (size == NULL) { 23863b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0); 2387dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer size = (GLint *) (_sizeBase + _sizeBufferOffset); 2388dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2389dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (type == NULL) { 23903b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0); 2391dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer type = (GLenum *) (_typeBase + _typeBufferOffset); 2392dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2393dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetActiveUniform( 2394dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLuint)program, 2395dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLuint)index, 2396dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer len, 2397dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer NULL, 2398dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLint *)size, 2399dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (GLenum *)type, 2400dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer (char *)buf 2401dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer ); 2402dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer 2403dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (_typeArray) { 24043b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE); 2405dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2406dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (_sizeArray) { 24073b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE); 2408dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2409dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer result = _env->NewStringUTF(buf); 2410dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (buf) { 2411dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer free(buf); 2412dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 2413dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return result; 2414dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer} 2415560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) */ 2416560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2417560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetAttachedShaders__II_3II_3II 2418560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint maxcount, jintArray count_ref, jint countOffset, jintArray shaders_ref, jint shadersOffset) { 2419560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 24202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 24212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 2422560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *count_base = (GLsizei *) 0; 2423560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _countRemaining; 2424560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *count = (GLsizei *) 0; 2425560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *shaders_base = (GLuint *) 0; 2426560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _shadersRemaining; 2427560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *shaders = (GLuint *) 0; 2428560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 24296aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (count_ref) { 24306aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (countOffset < 0) { 24316aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exception = 1; 24326aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionType = "java/lang/IllegalArgumentException"; 24336aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionMessage = "countOffset < 0"; 24346aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos goto exit; 24356aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos } 24366aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _countRemaining = _env->GetArrayLength(count_ref) - countOffset; 24376aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (_countRemaining < 1) { 24386aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exception = 1; 24396aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionType = "java/lang/IllegalArgumentException"; 24406aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionMessage = "length - countOffset < 1 < needed"; 24416aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos goto exit; 24426aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos } 24436aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos count_base = (GLsizei *) 24446aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _env->GetIntArrayElements(count_ref, (jboolean *)0); 24456aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos count = count_base + countOffset; 24462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 2447560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2448560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!shaders_ref) { 2449560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 24502545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 24512545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "shaders == null"; 2452560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2453560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2454560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (shadersOffset < 0) { 2455560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 24562545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 24572545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "shadersOffset < 0"; 2458560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2459560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2460560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _shadersRemaining = _env->GetArrayLength(shaders_ref) - shadersOffset; 24612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_shadersRemaining < maxcount) { 24622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 24632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 24642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - shadersOffset < maxcount < needed"; 24652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 24662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 2467560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich shaders_base = (GLuint *) 24683b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(shaders_ref, (jboolean *)0); 2469560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich shaders = shaders_base + shadersOffset; 2470560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2471560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetAttachedShaders( 2472560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 2473560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)maxcount, 2474560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei *)count, 2475560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)shaders 2476560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 2477560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2478560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 2479560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (shaders_base) { 24803b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(shaders_ref, (jint*)shaders_base, 2481560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 2482560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2483560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (count_base) { 24843b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(count_ref, (jint*)count_base, 2485560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 2486560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 24872545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 24882545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 24892545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 2490560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2491560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2492560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) */ 2493560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2494560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 2495560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint maxcount, jobject count_buf, jobject shaders_buf) { 24962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 24972ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 24982ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 24993b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _countArray = (jintArray) 0; 250017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _countBufferOffset = (jint) 0; 25013b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _shadersArray = (jintArray) 0; 250217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _shadersBufferOffset = (jint) 0; 2503560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _countRemaining; 2504560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *count = (GLsizei *) 0; 2505560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _shadersRemaining; 2506560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *shaders = (GLuint *) 0; 2507560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 25082ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (count_buf) { 25093b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi count = (GLsizei *)getPointer(_env, count_buf, (jarray*)&_countArray, &_countRemaining, &_countBufferOffset); 25102ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_countRemaining < 1) { 25112ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 25122ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 25132ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 1 < needed"; 25142ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 25152ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 25162ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 25176aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos shaders = (GLuint *)getPointer(_env, shaders_buf, (jarray*)&_shadersArray, &_shadersRemaining, &_shadersBufferOffset); 25186aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (_shadersRemaining < maxcount) { 25196aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exception = 1; 25206aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionType = "java/lang/IllegalArgumentException"; 25216aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionMessage = "remaining() < maxcount < needed"; 25226aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos goto exit; 25232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 25242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (count_buf && count == NULL) { 25253b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _countBase = (char *)_env->GetIntArrayElements(_countArray, (jboolean *) 0); 25262ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian count = (GLsizei *) (_countBase + _countBufferOffset); 25272ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 25286aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (shaders == NULL) { 25293b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _shadersBase = (char *)_env->GetIntArrayElements(_shadersArray, (jboolean *) 0); 253017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer shaders = (GLuint *) (_shadersBase + _shadersBufferOffset); 253117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 2532560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetAttachedShaders( 2533560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 2534560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)maxcount, 2535560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei *)count, 2536560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)shaders 2537560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 25382ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 25392ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 2540560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_shadersArray) { 25413b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_shadersArray, (jint*)shaders, _exception ? JNI_ABORT : 0); 254217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 254317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (_countArray) { 25443b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_countArray, (jint*)count, _exception ? JNI_ABORT : 0); 25452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 25462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 25472ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 2548560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2549560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2550560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 255189be00bcda2b5965757e83bdf70a650b64373045Mathias Agopian/* GLint glGetAttribLocation ( GLuint program, const char *name ) */ 2552560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jint 2553560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetAttribLocation__ILjava_lang_String_2 2554560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jstring name) { 25552545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 25562ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 25572ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 255889be00bcda2b5965757e83bdf70a650b64373045Mathias Agopian GLint _returnValue = 0; 2559560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich const char* _nativename = 0; 2560560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2561560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!name) { 2562428d3fcbe3596b18549cdada9fc68a29f159a946Elliott Hughes _exception = 1; 25632545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 25642545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "name == null"; 2565560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2566560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2567560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _nativename = _env->GetStringUTFChars(name, 0); 2568560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2569560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glGetAttribLocation( 2570560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 2571560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (char *)_nativename 2572560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 2573560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2574560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 2575560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_nativename) { 2576560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _env->ReleaseStringUTFChars(name, _nativename); 2577560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2578560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 25792545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 25802545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 25812545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 2582cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jint)_returnValue; 2583560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2584560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2585560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ 2586560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2587560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetBooleanv__I_3ZI 2588560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint pname, jbooleanArray params_ref, jint offset) { 25893b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi get<jbooleanArray, BooleanArrayGetter, jboolean*, BooleanArrayReleaser, GLboolean, glGetBooleanv>( 25903b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, _this, pname, params_ref, offset); 2591560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2592560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2593560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetBooleanv ( GLenum pname, GLboolean *params ) */ 2594560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2595560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetBooleanv__ILjava_nio_IntBuffer_2 2596560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 25973b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi getarray<GLboolean, jintArray, IntArrayGetter, jint*, IntArrayReleaser, glGetBooleanv>( 25983b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, _this, pname, params_buf); 2599560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2600560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 2601560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2602560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetBufferParameteriv__II_3II 2603560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 260473108675c944ab4ee89631dced23566b12341b66Jack Palevich jint _exception = 0; 26052ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 26062ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 260773108675c944ab4ee89631dced23566b12341b66Jack Palevich GLint *params_base = (GLint *) 0; 260873108675c944ab4ee89631dced23566b12341b66Jack Palevich jint _remaining; 260973108675c944ab4ee89631dced23566b12341b66Jack Palevich GLint *params = (GLint *) 0; 261073108675c944ab4ee89631dced23566b12341b66Jack Palevich 261173108675c944ab4ee89631dced23566b12341b66Jack Palevich if (!params_ref) { 261273108675c944ab4ee89631dced23566b12341b66Jack Palevich _exception = 1; 26132545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 26142545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 261573108675c944ab4ee89631dced23566b12341b66Jack Palevich goto exit; 261673108675c944ab4ee89631dced23566b12341b66Jack Palevich } 261773108675c944ab4ee89631dced23566b12341b66Jack Palevich if (offset < 0) { 261873108675c944ab4ee89631dced23566b12341b66Jack Palevich _exception = 1; 26192545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 26202545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 262173108675c944ab4ee89631dced23566b12341b66Jack Palevich goto exit; 262273108675c944ab4ee89631dced23566b12341b66Jack Palevich } 262373108675c944ab4ee89631dced23566b12341b66Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 262473108675c944ab4ee89631dced23566b12341b66Jack Palevich if (_remaining < 1) { 262573108675c944ab4ee89631dced23566b12341b66Jack Palevich _exception = 1; 26262545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 26272545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "length - offset < 1 < needed"; 262873108675c944ab4ee89631dced23566b12341b66Jack Palevich goto exit; 262973108675c944ab4ee89631dced23566b12341b66Jack Palevich } 263073108675c944ab4ee89631dced23566b12341b66Jack Palevich params_base = (GLint *) 26313b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(params_ref, (jboolean *)0); 263273108675c944ab4ee89631dced23566b12341b66Jack Palevich params = params_base + offset; 263373108675c944ab4ee89631dced23566b12341b66Jack Palevich 263473108675c944ab4ee89631dced23566b12341b66Jack Palevich glGetBufferParameteriv( 263573108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)target, 263673108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)pname, 263773108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLint *)params 263873108675c944ab4ee89631dced23566b12341b66Jack Palevich ); 263973108675c944ab4ee89631dced23566b12341b66Jack Palevich 264073108675c944ab4ee89631dced23566b12341b66Jack Palevichexit: 264173108675c944ab4ee89631dced23566b12341b66Jack Palevich if (params_base) { 26423b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 264373108675c944ab4ee89631dced23566b12341b66Jack Palevich _exception ? JNI_ABORT: 0); 264473108675c944ab4ee89631dced23566b12341b66Jack Palevich } 26452545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 26462545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 26472545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 2648560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2649560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2650560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 2651560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2652560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 2653560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 265473108675c944ab4ee89631dced23566b12341b66Jack Palevich jint _exception = 0; 26552ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 26562ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 26573b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 265817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 265973108675c944ab4ee89631dced23566b12341b66Jack Palevich jint _remaining; 266073108675c944ab4ee89631dced23566b12341b66Jack Palevich GLint *params = (GLint *) 0; 266173108675c944ab4ee89631dced23566b12341b66Jack Palevich 26623b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 266373108675c944ab4ee89631dced23566b12341b66Jack Palevich if (_remaining < 1) { 266473108675c944ab4ee89631dced23566b12341b66Jack Palevich _exception = 1; 26652545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 26662545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < 1 < needed"; 266773108675c944ab4ee89631dced23566b12341b66Jack Palevich goto exit; 266873108675c944ab4ee89631dced23566b12341b66Jack Palevich } 266917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 26703b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 267117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLint *) (_paramsBase + _bufferOffset); 267217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 267373108675c944ab4ee89631dced23566b12341b66Jack Palevich glGetBufferParameteriv( 267473108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)target, 267573108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLenum)pname, 267673108675c944ab4ee89631dced23566b12341b66Jack Palevich (GLint *)params 267773108675c944ab4ee89631dced23566b12341b66Jack Palevich ); 267873108675c944ab4ee89631dced23566b12341b66Jack Palevich 267973108675c944ab4ee89631dced23566b12341b66Jack Palevichexit: 268073108675c944ab4ee89631dced23566b12341b66Jack Palevich if (_array) { 26813b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 268273108675c944ab4ee89631dced23566b12341b66Jack Palevich } 26832545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 26842545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 26852545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 2686560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2687560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2688560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLenum glGetError ( void ) */ 2689560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jint 2690560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetError__ 2691560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this) { 2692560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLenum _returnValue; 2693560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glGetError(); 2694cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jint)_returnValue; 2695560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2696560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2697560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetFloatv ( GLenum pname, GLfloat *params ) */ 2698560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2699560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetFloatv__I_3FI 2700560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint pname, jfloatArray params_ref, jint offset) { 27013b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi get<jfloatArray, FloatArrayGetter, jfloat*, FloatArrayReleaser, GLfloat, glGetFloatv>( 27023b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, _this, pname, params_ref, offset); 2703560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2704560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2705560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetFloatv ( GLenum pname, GLfloat *params ) */ 2706560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2707560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetFloatv__ILjava_nio_FloatBuffer_2 2708560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 27093b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi getarray<GLfloat, jfloatArray, FloatArrayGetter, jfloat*, FloatArrayReleaser, glGetFloatv>( 27103b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, _this, pname, params_buf); 2711560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2712560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */ 2713560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2714560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetFramebufferAttachmentParameteriv__III_3II 2715560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jintArray params_ref, jint offset) { 2716560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 27172ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 27182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 2719560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params_base = (GLint *) 0; 2720560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 2721560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 2722560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2723560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 2724560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 27252545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 27262545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 2727560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2728560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2729560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 2730560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 27312545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 27322545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 2733560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2734560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2735560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 2736560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLint *) 27373b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(params_ref, (jboolean *)0); 2738560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 2739560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2740560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetFramebufferAttachmentParameteriv( 2741560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 2742560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)attachment, 2743560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 2744560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 2745560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 2746560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2747560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 2748560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 27493b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 2750560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 2751560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 27522545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 27532545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 27542545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 2755560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2756560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2757560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) */ 2758560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2759560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetFramebufferAttachmentParameteriv__IIILjava_nio_IntBuffer_2 2760560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint attachment, jint pname, jobject params_buf) { 27613b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 276217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 2763560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 2764560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 2765560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 27663b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 276717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 27683b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 276917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLint *) (_paramsBase + _bufferOffset); 277017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 2771560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetFramebufferAttachmentParameteriv( 2772560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 2773560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)attachment, 2774560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 2775560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 2776560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 2777560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 27783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)params, 0); 2779560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2780560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2781560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2782560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetIntegerv ( GLenum pname, GLint *params ) */ 2783560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2784560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetIntegerv__I_3II 2785560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint pname, jintArray params_ref, jint offset) { 27863b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi get<jintArray, IntArrayGetter, jint*, IntArrayReleaser, GLint, glGetIntegerv>( 27873b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, _this, pname, params_ref, offset); 2788560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2789560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2790560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetIntegerv ( GLenum pname, GLint *params ) */ 2791560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2792560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetIntegerv__ILjava_nio_IntBuffer_2 2793560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 27943b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi getarray<GLint, jintArray, IntArrayGetter, jint*, IntArrayReleaser, glGetIntegerv>( 27953b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env, _this, pname, params_buf); 2796560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2797560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) */ 2798560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2799560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetProgramiv__II_3II 2800560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint pname, jintArray params_ref, jint offset) { 2801560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 28022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 28032ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 2804560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params_base = (GLint *) 0; 2805560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 2806560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 2807560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2808560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 2809560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 28102545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 28112545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 2812560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2813560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2814560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 2815560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 28162545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 28172545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 2818560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2819560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2820560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 28212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 28222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 28232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 28242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < 1 < needed"; 28252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 28262ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 2827560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLint *) 28283b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(params_ref, (jboolean *)0); 2829560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 2830560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2831560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetProgramiv( 2832560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 2833560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 2834560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 2835560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 2836560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2837560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 2838560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 28393b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 2840560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 2841560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 28422545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 28432545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 28442545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 2845560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2846560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2847560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) */ 2848560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2849560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetProgramiv__IILjava_nio_IntBuffer_2 2850560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint pname, jobject params_buf) { 28512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 28522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 28532ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 28543b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 285517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 2856560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 2857560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 2858560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 28593b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 28602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 28612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 28622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 28632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 1 < needed"; 28642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 28652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 286617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 28673b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 286817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLint *) (_paramsBase + _bufferOffset); 286917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 2870560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetProgramiv( 2871560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 2872560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 2873560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 2874560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 28752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 28762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 2877560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 28783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 28792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 28802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 28812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 2882560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2883560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2884560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 288524ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes#include <stdlib.h> 2886560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2887560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetProgramInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */ 288824ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughesstatic jstring android_glGetProgramInfoLog(JNIEnv *_env, jobject, jint shader) { 2889560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint infoLen = 0; 2890560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetProgramiv(shader, GL_INFO_LOG_LENGTH, &infoLen); 289124ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes if (!infoLen) { 289224ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes return _env->NewStringUTF(""); 2893560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 289424ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes char* buf = (char*) malloc(infoLen); 289524ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes if (buf == NULL) { 289624ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 289724ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes return NULL; 2898560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 289924ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes glGetProgramInfoLog(shader, infoLen, NULL, buf); 290024ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes jstring result = _env->NewStringUTF(buf); 290124ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes free(buf); 290224ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes return result; 2903560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2904560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 2905560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2906560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetRenderbufferParameteriv__II_3II 2907560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 2908560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 29092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 29102ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 2911560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params_base = (GLint *) 0; 2912560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 2913560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 2914560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2915560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 2916560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 29172545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 29182545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 2919560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2920560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2921560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 2922560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 29232545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 29242545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 2925560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 2926560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2927560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 29282ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 29292ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 29302ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 29312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < 1 < needed"; 29322ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 29332ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 2934560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLint *) 29353b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(params_ref, (jboolean *)0); 2936560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 2937560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2938560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetRenderbufferParameteriv( 2939560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 2940560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 2941560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 2942560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 2943560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2944560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 2945560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 29463b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 2947560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 2948560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 29492545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 29502545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 29512545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 2952560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2953560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2954560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 2955560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2956560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2 2957560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 29582ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 29592ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 29602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 29613b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 296217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 2963560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 2964560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 2965560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 29663b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 29672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 29682ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 29692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 29702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 1 < needed"; 29712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 29722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 297317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 29743b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 297517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLint *) (_paramsBase + _bufferOffset); 297617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 2977560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetRenderbufferParameteriv( 2978560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 2979560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 2980560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 2981560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 29822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 29832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 2984560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 29853b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 29862ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 29872ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 29882ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 2989560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 2990560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 2991560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 2992560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) */ 2993560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 2994560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetShaderiv__II_3II 2995560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shader, jint pname, jintArray params_ref, jint offset) { 2996560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 29972ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 29982ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 2999560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params_base = (GLint *) 0; 3000560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3001560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 3002560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3003560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 3004560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 30052545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 30062545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 3007560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3008560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3009560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 3010560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 30112545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 30122545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 3013560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3014560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3015560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 30162ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 30172ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 30182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 30192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < 1 < needed"; 30202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 30212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3022560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLint *) 30233b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(params_ref, (jboolean *)0); 3024560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 3025560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3026560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetShaderiv( 3027560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)shader, 3028560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3029560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 3030560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3031560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3032560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3033560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 30343b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 3035560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3036560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 30372545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 30382545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 30392545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3040560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3041560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3042560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) */ 3043560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3044560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetShaderiv__IILjava_nio_IntBuffer_2 3045560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shader, jint pname, jobject params_buf) { 30462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 30472ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 30482ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 30493b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 305017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 3051560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3052560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 3053560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 30543b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 30552ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 30562ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 30572ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 30582ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 1 < needed"; 30592ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 30602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 306117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 30623b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 306317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLint *) (_paramsBase + _bufferOffset); 306417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 3065560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetShaderiv( 3066560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)shader, 3067560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3068560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 3069560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 30702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 30712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 3072560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 30733b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 30742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 30752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 30762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 3077560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3078560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3079560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 308024ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes#include <stdlib.h> 3081560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3082560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetShaderInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */ 308324ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughesstatic jstring android_glGetShaderInfoLog(JNIEnv *_env, jobject, jint shader) { 3084560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint infoLen = 0; 3085560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &infoLen); 308624ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes if (!infoLen) { 308724ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes return _env->NewStringUTF(""); 3088560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 308924ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes char* buf = (char*) malloc(infoLen); 309024ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes if (buf == NULL) { 309124ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 309224ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes return NULL; 3093560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 309424ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes glGetShaderInfoLog(shader, infoLen, NULL, buf); 309524ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes jstring result = _env->NewStringUTF(buf); 309624ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes free(buf); 309724ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes return result; 3098560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3099560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) */ 3100560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3101560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetShaderPrecisionFormat__II_3II_3II 3102560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jintArray range_ref, jint rangeOffset, jintArray precision_ref, jint precisionOffset) { 3103560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 31042ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 31052ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 3106560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *range_base = (GLint *) 0; 3107560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _rangeRemaining; 3108560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *range = (GLint *) 0; 3109560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *precision_base = (GLint *) 0; 3110560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _precisionRemaining; 3111560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *precision = (GLint *) 0; 3112560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3113560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!range_ref) { 3114560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 31152545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 31162545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "range == null"; 3117560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3118560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3119560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (rangeOffset < 0) { 3120560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 31212545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 31222545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "rangeOffset < 0"; 3123560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3124560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3125560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _rangeRemaining = _env->GetArrayLength(range_ref) - rangeOffset; 31262ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_rangeRemaining < 1) { 31272ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 31282ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 31292ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - rangeOffset < 1 < needed"; 31302ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 31312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3132560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich range_base = (GLint *) 31333b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(range_ref, (jboolean *)0); 3134560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich range = range_base + rangeOffset; 3135560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3136560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!precision_ref) { 3137560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 31382545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 31392545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "precision == null"; 3140560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3141560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3142560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (precisionOffset < 0) { 3143560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 31442545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 31452545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "precisionOffset < 0"; 3146560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3147560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3148560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _precisionRemaining = _env->GetArrayLength(precision_ref) - precisionOffset; 31492ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_precisionRemaining < 1) { 31502ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 31512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 31522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - precisionOffset < 1 < needed"; 31532ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 31542ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3155560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich precision_base = (GLint *) 31563b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(precision_ref, (jboolean *)0); 3157560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich precision = precision_base + precisionOffset; 3158560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3159560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetShaderPrecisionFormat( 3160560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)shadertype, 3161560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)precisiontype, 3162560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)range, 3163560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)precision 3164560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3165560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3166560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3167560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (precision_base) { 31683b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(precision_ref, (jint*)precision_base, 3169560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3170560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3171560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (range_base) { 31723b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(range_ref, (jint*)range_base, 3173560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3174560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 31752545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 31762545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 31772545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3178560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3179560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3180560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) */ 3181560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3182560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 3183560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shadertype, jint precisiontype, jobject range_buf, jobject precision_buf) { 31842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 31852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 31862ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 31873b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _rangeArray = (jintArray) 0; 318817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _rangeBufferOffset = (jint) 0; 31893b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _precisionArray = (jintArray) 0; 319017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _precisionBufferOffset = (jint) 0; 3191560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _rangeRemaining; 3192560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *range = (GLint *) 0; 3193560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _precisionRemaining; 3194560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *precision = (GLint *) 0; 3195560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 31963b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi range = (GLint *)getPointer(_env, range_buf, (jarray*)&_rangeArray, &_rangeRemaining, &_rangeBufferOffset); 31972ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_rangeRemaining < 1) { 31982ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 31992ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 32002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 1 < needed"; 32012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 32022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 32033b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi precision = (GLint *)getPointer(_env, precision_buf, (jarray*)&_precisionArray, &_precisionRemaining, &_precisionBufferOffset); 32042ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_precisionRemaining < 1) { 32052ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 32062ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 32072ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 1 < needed"; 32082ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 32092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 321017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (range == NULL) { 32113b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _rangeBase = (char *)_env->GetIntArrayElements(_rangeArray, (jboolean *) 0); 321217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer range = (GLint *) (_rangeBase + _rangeBufferOffset); 321317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 321417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (precision == NULL) { 32153b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _precisionBase = (char *)_env->GetIntArrayElements(_precisionArray, (jboolean *) 0); 321617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer precision = (GLint *) (_precisionBase + _precisionBufferOffset); 321717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 3218560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetShaderPrecisionFormat( 3219560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)shadertype, 3220560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)precisiontype, 3221560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)range, 3222560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)precision 3223560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 32242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 32252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 3226560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_precisionArray) { 32273b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_precisionArray, (jint*)precision, _exception ? JNI_ABORT : 0); 322817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 322917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (_rangeArray) { 32303b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_rangeArray, (jint*)range, _exception ? JNI_ABORT : 0); 32312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 32322ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 32332ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 3234560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3235560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3236560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3237560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */ 3238560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3239560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetShaderSource__II_3II_3BI 3240560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shader, jint bufsize, jintArray length_ref, jint lengthOffset, jbyteArray source_ref, jint sourceOffset) { 3241560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 32422545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer const char * _exceptionType; 32432545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer const char * _exceptionMessage; 3244560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *length_base = (GLsizei *) 0; 3245560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _lengthRemaining; 3246560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *length = (GLsizei *) 0; 3247560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich char *source_base = (char *) 0; 3248560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _sourceRemaining; 3249560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich char *source = (char *) 0; 3250560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 32516aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (length_ref) { 32526aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos if (lengthOffset < 0) { 32536aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exception = 1; 32546aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionType = "java/lang/IllegalArgumentException"; 32556aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _exceptionMessage = "lengthOffset < 0"; 32566aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos goto exit; 32576aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos } 32586aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; 32596aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos length_base = (GLsizei *) 32606aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos _env->GetIntArrayElements(length_ref, (jboolean *)0); 32616aff9068f91fdfef0bc55fda0721c180c0de9284Pablo Ceballos length = length_base + lengthOffset; 3262560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3263560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3264560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!source_ref) { 3265560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 32662545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 32672545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "source == null"; 3268560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3269560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3270560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (sourceOffset < 0) { 3271560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 32722545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 32732545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "sourceOffset < 0"; 3274560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3275560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3276560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _sourceRemaining = _env->GetArrayLength(source_ref) - sourceOffset; 3277560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich source_base = (char *) 32783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetByteArrayElements(source_ref, (jboolean *)0); 3279560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich source = source_base + sourceOffset; 3280560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3281560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetShaderSource( 3282560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)shader, 3283560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)bufsize, 3284560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei *)length, 3285560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (char *)source 3286560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3287560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3288560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3289560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (source_base) { 32903b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseByteArrayElements(source_ref, (jbyte*)source_base, 3291560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3292560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3293560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (length_base) { 32943b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(length_ref, (jint*)length_base, 3295560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3296560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 32972545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 32982545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 32992545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3300560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3301560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3302560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */ 3303560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3304560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetShaderSource__IILjava_nio_IntBuffer_2B 3305560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shader, jint bufsize, jobject length_buf, jbyte source) { 33063b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 330717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 3308560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3309560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLsizei *length = (GLsizei *) 0; 3310560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 33113b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 331217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (length == NULL) { 33133b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _lengthBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 331417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer length = (GLsizei *) (_lengthBase + _bufferOffset); 331517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 3316560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetShaderSource( 3317560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)shader, 3318560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)bufsize, 3319560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei *)length, 332001c26ea89d4bbea3cf550e9328742302dd9a2b25Ashok Bhat reinterpret_cast<char *>(source) 3321560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3322560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 33233b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _array, (jint*)length, JNI_TRUE); 3324560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3325560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3326560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3327dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer/* void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) */ 3328dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshoferstatic jstring android_glGetShaderSource(JNIEnv *_env, jobject, jint shader) { 3329dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer GLint shaderLen = 0; 3330dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetShaderiv((GLuint)shader, GL_SHADER_SOURCE_LENGTH, &shaderLen); 3331dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (!shaderLen) { 3332dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return _env->NewStringUTF(""); 3333dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 3334dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer char* buf = (char*) malloc(shaderLen); 3335dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer if (buf == NULL) { 3336dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); 3337dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return NULL; 3338dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer } 3339dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer glGetShaderSource(shader, shaderLen, NULL, buf); 3340dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer jstring result = _env->NewStringUTF(buf); 3341dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer free(buf); 3342dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer return result; 3343dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer} 3344560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* const GLubyte * glGetString ( GLenum name ) */ 334524ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughesstatic jstring android_glGetString(JNIEnv* _env, jobject, jint name) { 334624ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes const char* chars = (const char*) glGetString((GLenum) name); 334724ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes return _env->NewStringUTF(chars); 3348560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3349560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ 3350560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3351560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetTexParameterfv__II_3FI 3352560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { 3353560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 33542ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 33552ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 3356560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params_base = (GLfloat *) 0; 3357560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3358560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params = (GLfloat *) 0; 3359560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3360560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 3361560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 33622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 33632545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 3364560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3365560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3366560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 3367560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 33682545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 33692545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 3370560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3371560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3372560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 3373560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < 1) { 3374560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 33752545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 33762545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "length - offset < 1 < needed"; 3377560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3378560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3379560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLfloat *) 33803b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(params_ref, (jboolean *)0); 3381560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 3382560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3383560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetTexParameterfv( 3384560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 3385560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3386560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)params 3387560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3388560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3389560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3390560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 33913b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, 3392560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3393560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 33942545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 33952545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 33962545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3397560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3398560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3399560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) */ 3400560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3401560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 3402560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 3403560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 34042ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 34052ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 34063b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 340717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 3408560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3409560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params = (GLfloat *) 0; 3410560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 34113b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3412560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < 1) { 3413560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 34142545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 34152545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < 1 < needed"; 3416560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3417560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 341817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 34193b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 342017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLfloat *) (_paramsBase + _bufferOffset); 342117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 3422560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetTexParameterfv( 3423560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 3424560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3425560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)params 3426560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3427560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3428560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3429560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 34303b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); 3431560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 34322545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 34332545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 34342545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3435560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3436560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3437560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 3438560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3439560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetTexParameteriv__II_3II 3440560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 3441560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 34422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 34432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 3444560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params_base = (GLint *) 0; 3445560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3446560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 3447560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3448560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 3449560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 34502545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 34512545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 3452560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3453560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3454560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 3455560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 34562545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 34572545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 3458560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3459560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3460560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 3461560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < 1) { 3462560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 34632545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 34642545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "length - offset < 1 < needed"; 3465560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3466560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3467560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLint *) 34683b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(params_ref, (jboolean *)0); 3469560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 3470560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3471560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetTexParameteriv( 3472560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 3473560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3474560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 3475560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3476560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3477560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3478560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 34793b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 3480560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3481560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 34822545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 34832545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 34842545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3485560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3486560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3487560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) */ 3488560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3489560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetTexParameteriv__IILjava_nio_IntBuffer_2 3490560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 3491560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 34922ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 34932ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 34943b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 349517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 3496560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3497560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 3498560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 34993b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 3500560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < 1) { 3501560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 35022545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 35032545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < 1 < needed"; 3504560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3505560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 350617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 35073b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 350817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLint *) (_paramsBase + _bufferOffset); 350917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 3510560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetTexParameteriv( 3511560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 3512560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3513560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 3514560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3515560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3516560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3517560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 35183b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 3519560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 35202545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 35212545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 35222545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3523560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3524560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3525560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) */ 3526560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3527560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetUniformfv__II_3FI 3528560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint location, jfloatArray params_ref, jint offset) { 3529560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 35302ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 35312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 3532560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params_base = (GLfloat *) 0; 3533560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3534560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params = (GLfloat *) 0; 3535560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3536560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 3537560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 35382545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 35392545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 3540560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3541560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3542560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 3543560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 35442545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 35452545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 3546560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3547560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3548560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 35492ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 35502ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 35512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 35522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < 1 < needed"; 35532ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 35542ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3555560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLfloat *) 35563b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(params_ref, (jboolean *)0); 3557560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 3558560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3559560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetUniformfv( 3560560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 3561560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 3562560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)params 3563560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3564560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3565560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3566560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 35673b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, 3568560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3569560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 35702545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 35712545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 35722545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3573560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3574560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3575560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) */ 3576560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3577560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetUniformfv__IILjava_nio_FloatBuffer_2 3578560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) { 35792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 35802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 35812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 35823b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 358317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 3584560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3585560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params = (GLfloat *) 0; 3586560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 35873b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 35882ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 35892ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 35902ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 35912ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 1 < needed"; 35922ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 35932ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 359417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 35953b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 359617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLfloat *) (_paramsBase + _bufferOffset); 359717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 3598560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetUniformfv( 3599560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 3600560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 3601560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)params 3602560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 36032ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 36042ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 3605560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 36063b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); 36072ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 36082ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 36092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 3610560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3611560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3612560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3613560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetUniformiv ( GLuint program, GLint location, GLint *params ) */ 3614560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3615560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetUniformiv__II_3II 3616560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) { 3617560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 36182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 36192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 3620560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params_base = (GLint *) 0; 3621560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3622560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 3623560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3624560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 3625560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 36262545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 36272545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 3628560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3629560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3630560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 3631560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 36322545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 36332545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 3634560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3635560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3636560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 36372ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 36382ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 36392ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 36402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < 1 < needed"; 36412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 36422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3643560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLint *) 36443b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(params_ref, (jboolean *)0); 3645560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 3646560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3647560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetUniformiv( 3648560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 3649560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 3650560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 3651560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3652560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3653560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3654560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 36553b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 3656560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3657560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 36582545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 36592545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 36602545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3661560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3662560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3663560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetUniformiv ( GLuint program, GLint location, GLint *params ) */ 3664560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3665560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetUniformiv__IILjava_nio_IntBuffer_2 3666560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) { 36672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 36682ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 36692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 36703b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 367117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 3672560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3673560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 3674560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 36753b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 36762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 36772ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 36782ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 36792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 1 < needed"; 36802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 36812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 368217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 36833b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 368417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLint *) (_paramsBase + _bufferOffset); 368517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 3686560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetUniformiv( 3687560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 3688560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 3689560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 3690560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 36912ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 36922ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 3693560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 36943b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 36952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 36962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 36972ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 3698560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3699560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3700560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 370189be00bcda2b5965757e83bdf70a650b64373045Mathias Agopian/* GLint glGetUniformLocation ( GLuint program, const char *name ) */ 3702560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jint 3703560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetUniformLocation__ILjava_lang_String_2 3704560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program, jstring name) { 37052545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 37062ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 37072ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 370889be00bcda2b5965757e83bdf70a650b64373045Mathias Agopian GLint _returnValue = 0; 3709560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich const char* _nativename = 0; 3710560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3711560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!name) { 3712428d3fcbe3596b18549cdada9fc68a29f159a946Elliott Hughes _exception = 1; 37132545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 37142545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "name == null"; 3715560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3716560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3717560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _nativename = _env->GetStringUTFChars(name, 0); 3718560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3719560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glGetUniformLocation( 3720560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program, 3721560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (char *)_nativename 3722560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3723560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3724560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3725560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_nativename) { 3726560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _env->ReleaseStringUTFChars(name, _nativename); 3727560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3728560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 37292545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 37302545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 37312545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3732cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jint)_returnValue; 3733560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3734560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3735560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) */ 3736560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3737560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetVertexAttribfv__II_3FI 3738560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint index, jint pname, jfloatArray params_ref, jint offset) { 3739560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 37402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 37412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 3742560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params_base = (GLfloat *) 0; 3743560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3744560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params = (GLfloat *) 0; 3745560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3746560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 3747560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 37482545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 37492545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 3750560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3751560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3752560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 3753560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 37542545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 37552545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 3756560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3757560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3758560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 37592ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian int _needed; 37602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian switch (pname) { 37612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#if defined(GL_CURRENT_VERTEX_ATTRIB) 37622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_CURRENT_VERTEX_ATTRIB: 37632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#endif // defined(GL_CURRENT_VERTEX_ATTRIB) 37642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = 4; 37652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 37662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian default: 37672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = 1; 37682ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 37692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 37702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < _needed) { 37712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 37722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 37732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < needed"; 37742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 37752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3776560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLfloat *) 37773b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(params_ref, (jboolean *)0); 3778560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 3779560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3780560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetVertexAttribfv( 3781560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index, 3782560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3783560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)params 3784560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3785560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3786560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3787560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 37883b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, 3789560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3790560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 37912545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 37922545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 37932545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3794560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3795560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3796560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) */ 3797560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3798560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2 3799560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) { 38002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 38012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 38022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 38033b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 380417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 3805560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3806560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params = (GLfloat *) 0; 3807560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 38083b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 38092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian int _needed; 38102ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian switch (pname) { 38112ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#if defined(GL_CURRENT_VERTEX_ATTRIB) 38122ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_CURRENT_VERTEX_ATTRIB: 38132ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#endif // defined(GL_CURRENT_VERTEX_ATTRIB) 38142ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = 4; 38152ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 38162ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian default: 38172ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = 1; 38182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 38192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 38202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < _needed) { 38212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 38222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 38232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < needed"; 38242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 38252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 382617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 38273b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 382817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLfloat *) (_paramsBase + _bufferOffset); 382917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 3830560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetVertexAttribfv( 3831560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index, 3832560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3833560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)params 3834560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 38352ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 38362ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 3837560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 38383b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)params, _exception ? JNI_ABORT : 0); 38392ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 38402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 38412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 3842560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3843560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3844560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3845560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) */ 3846560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3847560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetVertexAttribiv__II_3II 3848560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) { 3849560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _exception = 0; 38502ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 38512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 3852560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params_base = (GLint *) 0; 3853560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3854560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 3855560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3856560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 3857560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 38582545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 38592545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 3860560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3861560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3862560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 3863560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception = 1; 38642545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 38652545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 3866560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 3867560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3868560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 38692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian int _needed; 38702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian switch (pname) { 38712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#if defined(GL_CURRENT_VERTEX_ATTRIB) 38722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_CURRENT_VERTEX_ATTRIB: 38732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#endif // defined(GL_CURRENT_VERTEX_ATTRIB) 38742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = 4; 38752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 38762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian default: 38772ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = 1; 38782ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 38792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 38802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < _needed) { 38812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 38822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 38832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < needed"; 38842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 38852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 3886560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLint *) 38873b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(params_ref, (jboolean *)0); 3888560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 3889560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3890560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetVertexAttribiv( 3891560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index, 3892560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3893560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 3894560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3895560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3896560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 3897560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 38983b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 3899560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _exception ? JNI_ABORT: 0); 3900560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 39012545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 39022545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 39032545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 3904560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3905560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3906560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) */ 3907560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3908560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glGetVertexAttribiv__IILjava_nio_IntBuffer_2 3909560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) { 39102ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 39112ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 39122ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 39133b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 391417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 3915560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 3916560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 3917560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 39183b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 39192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian int _needed; 39202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian switch (pname) { 39212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#if defined(GL_CURRENT_VERTEX_ATTRIB) 39222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian case GL_CURRENT_VERTEX_ATTRIB: 39232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian#endif // defined(GL_CURRENT_VERTEX_ATTRIB) 39242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = 4; 39252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 39262ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian default: 39272ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _needed = 1; 39282ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian break; 39292ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 39302ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < _needed) { 39312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 39322ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 39332ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < needed"; 39342ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 39352ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 393617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 39373b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 393817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLint *) (_paramsBase + _bufferOffset); 393917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 3940560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glGetVertexAttribiv( 3941560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)index, 3942560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 3943560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 3944560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 39452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 39462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 3947560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 39483b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)params, _exception ? JNI_ABORT : 0); 39492ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 39502ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 39512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 3952560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 3953560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3954560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3955560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glHint ( GLenum target, GLenum mode ) */ 3956560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 3957560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glHint__II 3958560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint mode) { 3959560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glHint( 3960560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 3961560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)mode 3962560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3963560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3964560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3965560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLboolean glIsBuffer ( GLuint buffer ) */ 3966560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jboolean 3967560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glIsBuffer__I 3968560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint buffer) { 3969560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLboolean _returnValue; 3970560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glIsBuffer( 3971560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)buffer 3972560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3973cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jboolean)_returnValue; 3974560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3975560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3976560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLboolean glIsEnabled ( GLenum cap ) */ 3977560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jboolean 3978560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glIsEnabled__I 3979560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint cap) { 3980560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLboolean _returnValue; 3981560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glIsEnabled( 3982560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)cap 3983560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3984cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jboolean)_returnValue; 3985560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3986560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3987560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLboolean glIsFramebuffer ( GLuint framebuffer ) */ 3988560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jboolean 3989560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glIsFramebuffer__I 3990560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint framebuffer) { 3991560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLboolean _returnValue; 3992560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glIsFramebuffer( 3993560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)framebuffer 3994560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 3995cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jboolean)_returnValue; 3996560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 3997560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 3998560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLboolean glIsProgram ( GLuint program ) */ 3999560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jboolean 4000560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glIsProgram__I 4001560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program) { 4002560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLboolean _returnValue; 4003560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glIsProgram( 4004560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program 4005560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4006cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jboolean)_returnValue; 4007560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4008560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4009560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLboolean glIsRenderbuffer ( GLuint renderbuffer ) */ 4010560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jboolean 4011560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glIsRenderbuffer__I 4012560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint renderbuffer) { 4013560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLboolean _returnValue; 4014560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glIsRenderbuffer( 4015560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)renderbuffer 4016560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4017cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jboolean)_returnValue; 4018560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4019560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4020560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLboolean glIsShader ( GLuint shader ) */ 4021560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jboolean 4022560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glIsShader__I 4023560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shader) { 4024560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLboolean _returnValue; 4025560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glIsShader( 4026560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)shader 4027560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4028cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jboolean)_returnValue; 4029560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4030560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4031560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* GLboolean glIsTexture ( GLuint texture ) */ 4032560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic jboolean 4033560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glIsTexture__I 4034560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint texture) { 4035560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLboolean _returnValue; 4036560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _returnValue = glIsTexture( 4037560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)texture 4038560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4039cee5198e7199fcbb131ff0d30165fb1d5c0107cfAndy McFadden return (jboolean)_returnValue; 4040560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4041560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4042560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glLineWidth ( GLfloat width ) */ 4043560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4044560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glLineWidth__F 4045560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jfloat width) { 4046560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glLineWidth( 4047560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)width 4048560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4049560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4050560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4051560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glLinkProgram ( GLuint program ) */ 4052560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4053560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glLinkProgram__I 4054560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program) { 4055560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glLinkProgram( 4056560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program 4057560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4058560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4059560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4060560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glPixelStorei ( GLenum pname, GLint param ) */ 4061560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4062560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glPixelStorei__II 4063560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint pname, jint param) { 4064560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glPixelStorei( 4065560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 4066560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)param 4067560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4068560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4069560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4070560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glPolygonOffset ( GLfloat factor, GLfloat units ) */ 4071560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4072560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glPolygonOffset__FF 4073560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jfloat factor, jfloat units) { 4074560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glPolygonOffset( 4075560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)factor, 4076560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)units 4077560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4078560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4079560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4080560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) */ 4081560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4082560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glReadPixels__IIIIIILjava_nio_Buffer_2 4083560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jobject pixels_buf) { 4084560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 408517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4086560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4087560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *pixels = (GLvoid *) 0; 4088560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 40893b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 409017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (pixels == NULL) { 409117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 409217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer pixels = (GLvoid *) (_pixelsBase + _bufferOffset); 409317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 4094560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glReadPixels( 4095560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)x, 4096560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)y, 4097560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 4098560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height, 4099560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)format, 4100560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)type, 4101560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)pixels 4102560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4103560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 41042545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer releasePointer(_env, _array, pixels, JNI_TRUE); 4105560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4106560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4107560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4108560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glReleaseShaderCompiler ( void ) */ 4109560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4110560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glReleaseShaderCompiler__ 4111560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this) { 4112560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glReleaseShaderCompiler(); 4113560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4114560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4115560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) */ 4116560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4117560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glRenderbufferStorage__IIII 4118560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint width, jint height) { 4119560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glRenderbufferStorage( 4120560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 4121560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)internalformat, 4122560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 4123560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height 4124560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4125560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4126560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4127560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glSampleCoverage ( GLclampf value, GLboolean invert ) */ 4128560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4129560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glSampleCoverage__FZ 4130560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jfloat value, jboolean invert) { 4131560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glSampleCoverage( 4132560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLclampf)value, 4133560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)invert 4134560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4135560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4136560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4137560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) */ 4138560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4139560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glScissor__IIII 4140560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { 4141560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glScissor( 4142560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)x, 4143560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)y, 4144560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 4145560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height 4146560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4147560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4148560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4149560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) */ 4150560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4151560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glShaderBinary__I_3IIILjava_nio_Buffer_2I 4152560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jintArray shaders_ref, jint offset, jint binaryformat, jobject binary_buf, jint length) { 41532545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 41542ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 41552ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 4156560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 415717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4158560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *shaders_base = (GLuint *) 0; 4159560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _shadersRemaining; 4160560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *shaders = (GLuint *) 0; 4161560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _binaryRemaining; 4162560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *binary = (GLvoid *) 0; 4163560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4164560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!shaders_ref) { 41652545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 41662545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 41672545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "shaders == null"; 4168560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4169560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4170560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 41712545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 41722545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 41732545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 4174560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4175560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4176560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _shadersRemaining = _env->GetArrayLength(shaders_ref) - offset; 4177560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich shaders_base = (GLuint *) 41783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(shaders_ref, (jboolean *)0); 4179560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich shaders = shaders_base + offset; 4180560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 41813b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_binaryRemaining, &_bufferOffset); 41822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_binaryRemaining < length) { 41832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 41842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 41852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < length < needed"; 41862ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 41872ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 418817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (binary == NULL) { 418917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 419017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer binary = (GLvoid *) (_binaryBase + _bufferOffset); 419117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 4192560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glShaderBinary( 4193560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 4194560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)shaders, 4195560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)binaryformat, 4196560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)binary, 4197560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)length 4198560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4199560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4200560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 4201560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 4202560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich releasePointer(_env, _array, binary, JNI_FALSE); 4203560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4204560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (shaders_base) { 42053b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(shaders_ref, (jint*)shaders_base, 4206560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 4207560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 42082545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 42092545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 42102545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 4211560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4212560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4213560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) */ 4214560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4215560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I 4216560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint n, jobject shaders_buf, jint binaryformat, jobject binary_buf, jint length) { 42172ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 42182ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 42192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 42203b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _shadersArray = (jintArray) 0; 422117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _shadersBufferOffset = (jint) 0; 42223b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _binaryArray = (jintArray) 0; 422317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _binaryBufferOffset = (jint) 0; 4224560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _shadersRemaining; 4225560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLuint *shaders = (GLuint *) 0; 4226560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _binaryRemaining; 4227560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *binary = (GLvoid *) 0; 4228560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 42293b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi shaders = (GLuint *)getPointer(_env, shaders_buf, (jarray*)&_shadersArray, &_shadersRemaining, &_shadersBufferOffset); 42303b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_binaryArray, &_binaryRemaining, &_binaryBufferOffset); 42312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_binaryRemaining < length) { 42322ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 42332ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 42342ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < length < needed"; 42352ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 42362ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 423717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (shaders == NULL) { 42383b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _shadersBase = (char *)_env->GetIntArrayElements(_shadersArray, (jboolean *) 0); 423917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer shaders = (GLuint *) (_shadersBase + _shadersBufferOffset); 424017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 424117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (binary == NULL) { 424217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0); 424317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer binary = (GLvoid *) (_binaryBase + _binaryBufferOffset); 424417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 4245560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glShaderBinary( 4246560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)n, 4247560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint *)shaders, 4248560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)binaryformat, 4249560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)binary, 4250560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)length 4251560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 42522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 42532ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 4254560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_binaryArray) { 425517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer releasePointer(_env, _binaryArray, binary, JNI_FALSE); 425617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 425717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (_shadersArray) { 42583b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_shadersArray, (jint*)shaders, JNI_ABORT); 4259560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 42602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 42612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 42622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4263560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4264560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4265560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4266560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glShaderSource ( GLuint shader, GLsizei count, const GLchar ** string, const GLint * length ) */ 4267560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic 4268560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichvoid 4269560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glShaderSource 4270560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint shader, jstring string) { 4271560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4272560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!string) { 427324ce5fb2cc09d0a14406e7b935f8648c5720d27eElliott Hughes jniThrowException(_env, "java/lang/IllegalArgumentException", "string == null"); 4274560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich return; 4275560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4276560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4277560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich const char* nativeString = _env->GetStringUTFChars(string, 0); 4278560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich const char* strings[] = {nativeString}; 4279560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glShaderSource(shader, 1, strings, 0); 4280560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _env->ReleaseStringUTFChars(string, nativeString); 4281560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4282560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) */ 4283560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4284560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glStencilFunc__III 4285560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint func, jint ref, jint mask) { 4286560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glStencilFunc( 4287560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)func, 4288560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)ref, 4289560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)mask 4290560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4291560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4292560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4293560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glStencilFuncSeparate ( GLenum face, GLenum func, GLint ref, GLuint mask ) */ 4294560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4295560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glStencilFuncSeparate__IIII 4296560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint face, jint func, jint ref, jint mask) { 4297560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glStencilFuncSeparate( 4298560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)face, 4299560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)func, 4300560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)ref, 4301560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)mask 4302560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4303560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4304560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4305560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glStencilMask ( GLuint mask ) */ 4306560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4307560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glStencilMask__I 4308560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint mask) { 4309560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glStencilMask( 4310560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)mask 4311560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4312560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4313560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4314560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glStencilMaskSeparate ( GLenum face, GLuint mask ) */ 4315560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4316560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glStencilMaskSeparate__II 4317560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint face, jint mask) { 4318560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glStencilMaskSeparate( 4319560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)face, 4320560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)mask 4321560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4322560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4323560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4324560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) */ 4325560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4326560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glStencilOp__III 4327560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint fail, jint zfail, jint zpass) { 4328560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glStencilOp( 4329560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)fail, 4330560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)zfail, 4331560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)zpass 4332560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4333560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4334560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4335560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glStencilOpSeparate ( GLenum face, GLenum fail, GLenum zfail, GLenum zpass ) */ 4336560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4337560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glStencilOpSeparate__IIII 4338560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint face, jint fail, jint zfail, jint zpass) { 4339560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glStencilOpSeparate( 4340560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)face, 4341560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)fail, 4342560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)zfail, 4343560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)zpass 4344560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4345560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4346560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4347560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */ 4348560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4349560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 4350560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint border, jint format, jint type, jobject pixels_buf) { 4351560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 435217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4353560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4354560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *pixels = (GLvoid *) 0; 4355560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4356560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (pixels_buf) { 43573b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 435817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 435937c9b49ab5eb5a676370fd7081db0967c38e97a6Thomas Tafertshofer if (pixels_buf && pixels == NULL) { 436017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 436117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer pixels = (GLvoid *) (_pixelsBase + _bufferOffset); 4362560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4363560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glTexImage2D( 4364560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 4365560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)level, 4366560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)internalformat, 4367560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 4368560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height, 4369560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)border, 4370560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)format, 4371560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)type, 4372560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)pixels 4373560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4374560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 4375560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich releasePointer(_env, _array, pixels, JNI_FALSE); 4376560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4377560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4378560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4379560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) */ 4380560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4381560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glTexParameterf__IIF 4382560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jfloat param) { 4383560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glTexParameterf( 4384560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 4385560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 4386560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)param 4387560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4388560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4389560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4390560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ 4391560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4392560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glTexParameterfv__II_3FI 4393560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jfloatArray params_ref, jint offset) { 43942545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 43952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 43962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 4397560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params_base = (GLfloat *) 0; 4398560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4399560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params = (GLfloat *) 0; 4400560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4401560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 44022545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 44032545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 44042545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 4405560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4406560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4407560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 44082545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 44092545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 44102545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 4411560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4412560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4413560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 4414560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < 1) { 44152545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 44162545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 44172545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "length - offset < 1 < needed"; 4418560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4419560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4420560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLfloat *) 44213b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(params_ref, (jboolean *)0); 4422560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 4423560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4424560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glTexParameterfv( 4425560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 4426560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 4427560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)params 4428560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4429560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4430560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 4431560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 44323b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base, 4433560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 4434560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 44352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 44362545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 44372545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 4438560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4439560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4440560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) */ 4441560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4442560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glTexParameterfv__IILjava_nio_FloatBuffer_2 4443560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 44442545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 44452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 44462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 44473b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 444817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4449560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4450560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *params = (GLfloat *) 0; 4451560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 44523b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 4453560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < 1) { 44542545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 44552545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 44562545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < 1 < needed"; 4457560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4458560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 445917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 44603b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 446117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLfloat *) (_paramsBase + _bufferOffset); 446217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 4463560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glTexParameterfv( 4464560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 4465560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 4466560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)params 4467560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4468560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4469560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 4470560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 44713b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)params, JNI_ABORT); 4472560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 44732545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 44742545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 44752545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 4476560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4477560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4478560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glTexParameteri ( GLenum target, GLenum pname, GLint param ) */ 4479560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4480560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glTexParameteri__III 4481560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) { 4482560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glTexParameteri( 4483560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 4484560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 4485560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)param 4486560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4487560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4488560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4489560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ 4490560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4491560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glTexParameteriv__II_3II 4492560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 44932545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 44942ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 44952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 4496560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params_base = (GLint *) 0; 4497560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4498560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 4499560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4500560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!params_ref) { 45012545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 45022545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 45032545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "params == null"; 4504560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4505560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4506560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 45072545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 45082545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 45092545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 4510560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4511560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4512560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(params_ref) - offset; 4513560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < 1) { 45142545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 45152545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 45162545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "length - offset < 1 < needed"; 4517560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4518560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4519560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params_base = (GLint *) 45203b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(params_ref, (jboolean *)0); 4521560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich params = params_base + offset; 4522560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4523560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glTexParameteriv( 4524560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 4525560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 4526560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 4527560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4528560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4529560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 4530560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (params_base) { 45313b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(params_ref, (jint*)params_base, 4532560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 4533560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 45342545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 45352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 45362545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 4537560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4538560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4539560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) */ 4540560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4541560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glTexParameteriv__IILjava_nio_IntBuffer_2 4542560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 45432545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 45442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 45452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 45463b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 454717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4548560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4549560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *params = (GLint *) 0; 4550560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 45513b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 4552560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_remaining < 1) { 45532545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 45542545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 45552545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "remaining() < 1 < needed"; 4556560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4557560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 455817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (params == NULL) { 45593b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 456017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer params = (GLint *) (_paramsBase + _bufferOffset); 456117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 4562560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glTexParameteriv( 4563560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 4564560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)pname, 4565560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)params 4566560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4567560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4568560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 4569560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 45703b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)params, JNI_ABORT); 4571560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 45722545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 45732545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 45742545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 4575560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4576560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4577560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) */ 4578560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4579560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 4580560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint width, jint height, jint format, jint type, jobject pixels_buf) { 4581560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 458217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4583560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4584560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *pixels = (GLvoid *) 0; 4585560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4586560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (pixels_buf) { 45873b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 458817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 458937c9b49ab5eb5a676370fd7081db0967c38e97a6Thomas Tafertshofer if (pixels_buf && pixels == NULL) { 459017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 459117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer pixels = (GLvoid *) (_pixelsBase + _bufferOffset); 4592560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4593560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glTexSubImage2D( 4594560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)target, 4595560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)level, 4596560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)xoffset, 4597560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)yoffset, 4598560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 4599560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height, 4600560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)format, 4601560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)type, 4602560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)pixels 4603560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4604560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 4605560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich releasePointer(_env, _array, pixels, JNI_FALSE); 4606560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4607560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4608560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4609560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform1f ( GLint location, GLfloat x ) */ 4610560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4611560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform1f__IF 4612560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jfloat x) { 4613560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform1f( 4614560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4615560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)x 4616560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4617560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4618560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4619560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) */ 4620560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4621560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform1fv__II_3FI 4622560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { 46232545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 46242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 46252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 4626560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v_base = (GLfloat *) 0; 4627560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4628560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v = (GLfloat *) 0; 4629560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4630560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!v_ref) { 46312545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 46322545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 46332545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "v == null"; 4634560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4635560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4636560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 46372545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 46382545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 46392545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 4640560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4641560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4642560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(v_ref) - offset; 46432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count) { 46442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 46452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 46462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count < needed"; 46472ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 46482ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4649560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v_base = (GLfloat *) 46503b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(v_ref, (jboolean *)0); 4651560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v = v_base + offset; 4652560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4653560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform1fv( 4654560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4655560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 4656560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)v 4657560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4658560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4659560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 4660560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (v_base) { 46613b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(v_ref, (jfloat*)v_base, 4662560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 4663560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 46642545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 46652545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 46662545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 4667560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4668560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4669560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) */ 4670560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4671560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform1fv__IILjava_nio_FloatBuffer_2 4672560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 46732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 46742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 46752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 46763b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 467717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4678560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4679560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v = (GLfloat *) 0; 4680560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 46813b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi v = (GLfloat *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 46822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count) { 46832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 46842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 46852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count < needed"; 46862ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 46872ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 468817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (v == NULL) { 46893b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _vBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 469017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer v = (GLfloat *) (_vBase + _bufferOffset); 469117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 4692560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform1fv( 4693560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4694560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 4695560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)v 4696560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 46972ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 46982ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 4699560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 47003b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)v, JNI_ABORT); 4701560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 47022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 47032ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 47042ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4705560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4706560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4707560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform1i ( GLint location, GLint x ) */ 4708560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4709560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform1i__II 4710560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint x) { 4711560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform1i( 4712560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4713560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)x 4714560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4715560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4716560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4717560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) */ 4718560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4719560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform1iv__II_3II 4720560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { 47212545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 47222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 47232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 4724560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v_base = (GLint *) 0; 4725560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4726560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v = (GLint *) 0; 4727560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4728560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!v_ref) { 47292545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 47302545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 47312545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "v == null"; 4732560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4733560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4734560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 47352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 47362545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 47372545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 4738560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4739560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4740560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(v_ref) - offset; 47412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count) { 47422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 47432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 47442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count < needed"; 47452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 47462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4747560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v_base = (GLint *) 47483b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(v_ref, (jboolean *)0); 4749560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v = v_base + offset; 4750560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4751560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform1iv( 4752560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4753560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 4754560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)v 4755560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4756560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4757560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 4758560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (v_base) { 47593b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(v_ref, (jint*)v_base, 4760560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 4761560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 47622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 47632545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 47642545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 4765560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4766560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4767560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) */ 4768560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4769560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform1iv__IILjava_nio_IntBuffer_2 4770560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 47712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 47722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 47732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 47743b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 477517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4776560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4777560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v = (GLint *) 0; 4778560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 47793b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 47802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count) { 47812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 47822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 47832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count < needed"; 47842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 47852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 478617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (v == NULL) { 47873b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 478817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer v = (GLint *) (_vBase + _bufferOffset); 478917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 4790560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform1iv( 4791560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4792560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 4793560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)v 4794560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 47952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 47962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 4797560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 47983b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT); 4799560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 48002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 48012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 48022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4803560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4804560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4805560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform2f ( GLint location, GLfloat x, GLfloat y ) */ 4806560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4807560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform2f__IFF 4808560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y) { 4809560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform2f( 4810560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4811560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)x, 4812560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)y 4813560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4814560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4815560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4816560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) */ 4817560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4818560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform2fv__II_3FI 4819560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { 48202545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 48212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 48222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 4823560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v_base = (GLfloat *) 0; 4824560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4825560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v = (GLfloat *) 0; 4826560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4827560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!v_ref) { 48282545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 48292545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 48302545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "v == null"; 4831560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4832560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4833560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 48342545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 48352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 48362545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 4837560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4838560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4839560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(v_ref) - offset; 48402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*2) { 48412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 48422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 48432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count*2 < needed"; 48442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 48452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4846560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v_base = (GLfloat *) 48473b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(v_ref, (jboolean *)0); 4848560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v = v_base + offset; 4849560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4850560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform2fv( 4851560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4852560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 4853560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)v 4854560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4855560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4856560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 4857560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (v_base) { 48583b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(v_ref, (jfloat*)v_base, 4859560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 4860560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 48612545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 48622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 48632545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 4864560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4865560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4866560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) */ 4867560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4868560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform2fv__IILjava_nio_FloatBuffer_2 4869560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 48702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 48712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 48722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 48733b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 487417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4875560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4876560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v = (GLfloat *) 0; 4877560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 48783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi v = (GLfloat *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 48792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*2) { 48802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 48812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 48822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count*2 < needed"; 48832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 48842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 488517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (v == NULL) { 48863b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _vBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 488717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer v = (GLfloat *) (_vBase + _bufferOffset); 488817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 4889560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform2fv( 4890560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4891560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 4892560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)v 4893560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 48942ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 48952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 4896560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 48973b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)v, JNI_ABORT); 4898560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 48992ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 49002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 49012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4902560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4903560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4904560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform2i ( GLint location, GLint x, GLint y ) */ 4905560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4906560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform2i__III 4907560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint x, jint y) { 4908560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform2i( 4909560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4910560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)x, 4911560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)y 4912560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4913560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4914560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4915560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) */ 4916560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4917560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform2iv__II_3II 4918560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { 49192545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 49202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 49212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 4922560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v_base = (GLint *) 0; 4923560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4924560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v = (GLint *) 0; 4925560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4926560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!v_ref) { 49272545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 49282545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 49292545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "v == null"; 4930560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4931560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4932560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 49332545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 49342545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 49352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 4936560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 4937560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 4938560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(v_ref) - offset; 49392ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*2) { 49402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 49412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 49422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count*2 < needed"; 49432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 49442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 4945560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v_base = (GLint *) 49463b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(v_ref, (jboolean *)0); 4947560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v = v_base + offset; 4948560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4949560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform2iv( 4950560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4951560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 4952560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)v 4953560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 4954560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4955560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 4956560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (v_base) { 49573b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(v_ref, (jint*)v_base, 4958560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 4959560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 49602545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 49612545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 49622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 4963560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 4964560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 4965560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) */ 4966560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 4967560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform2iv__IILjava_nio_IntBuffer_2 4968560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 49692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 49702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 49712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 49723b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 497317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 4974560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 4975560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v = (GLint *) 0; 4976560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 49773b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 49782ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*2) { 49792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 49802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 49812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count*2 < needed"; 49822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 49832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 498417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (v == NULL) { 49853b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 498617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer v = (GLint *) (_vBase + _bufferOffset); 498717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 4988560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform2iv( 4989560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 4990560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 4991560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)v 4992560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 49932ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 49942ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 4995560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 49963b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT); 4997560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 49982ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 49992ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 50002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5001560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5002560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5003560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z ) */ 5004560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5005560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform3f__IFFF 5006560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y, jfloat z) { 5007560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform3f( 5008560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5009560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)x, 5010560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)y, 5011560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)z 5012560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5013560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5014560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5015560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5016560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5017560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform3fv__II_3FI 5018560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { 50192545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 50202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 50212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5022560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v_base = (GLfloat *) 0; 5023560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5024560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v = (GLfloat *) 0; 5025560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5026560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!v_ref) { 50272545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 50282545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 50292545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "v == null"; 5030560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5031560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5032560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 50332545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 50342545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 50352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5036560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5037560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5038560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(v_ref) - offset; 50392ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*3) { 50402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 50412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 50422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count*3 < needed"; 50432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 50442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5045560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v_base = (GLfloat *) 50463b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(v_ref, (jboolean *)0); 5047560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v = v_base + offset; 5048560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5049560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform3fv( 5050560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5051560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5052560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)v 5053560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5054560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5055560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5056560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (v_base) { 50573b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(v_ref, (jfloat*)v_base, 5058560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5059560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 50602545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 50612545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 50622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5063560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5064560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5065560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5066560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5067560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform3fv__IILjava_nio_FloatBuffer_2 5068560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 50692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 50702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 50712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 50723b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 507317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5074560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5075560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v = (GLfloat *) 0; 5076560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 50773b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi v = (GLfloat *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 50782ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*3) { 50792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 50802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 50812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count*3 < needed"; 50822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 50832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 508417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (v == NULL) { 50853b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _vBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 508617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer v = (GLfloat *) (_vBase + _bufferOffset); 508717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5088560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform3fv( 5089560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5090560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5091560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)v 5092560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 50932ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 50942ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5095560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 50963b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)v, JNI_ABORT); 5097560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 50982ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 50992ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 51002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5101560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5102560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5103560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform3i ( GLint location, GLint x, GLint y, GLint z ) */ 5104560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5105560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform3i__IIII 5106560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint x, jint y, jint z) { 5107560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform3i( 5108560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5109560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)x, 5110560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)y, 5111560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)z 5112560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5113560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5114560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5115560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) */ 5116560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5117560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform3iv__II_3II 5118560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { 51192545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 51202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 51212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5122560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v_base = (GLint *) 0; 5123560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5124560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v = (GLint *) 0; 5125560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5126560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!v_ref) { 51272545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 51282545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 51292545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "v == null"; 5130560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5131560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5132560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 51332545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 51342545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 51352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5136560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5137560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5138560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(v_ref) - offset; 51392ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*3) { 51402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 51412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 51422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count*3 < needed"; 51432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 51442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5145560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v_base = (GLint *) 51463b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(v_ref, (jboolean *)0); 5147560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v = v_base + offset; 5148560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5149560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform3iv( 5150560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5151560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5152560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)v 5153560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5154560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5155560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5156560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (v_base) { 51573b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(v_ref, (jint*)v_base, 5158560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5159560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 51602545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 51612545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 51622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5163560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5164560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5165560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) */ 5166560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5167560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform3iv__IILjava_nio_IntBuffer_2 5168560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 51692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 51702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 51712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 51723b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 517317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5174560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5175560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v = (GLint *) 0; 5176560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 51773b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 51782ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*3) { 51792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 51802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 51812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count*3 < needed"; 51822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 51832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 518417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (v == NULL) { 51853b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 518617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer v = (GLint *) (_vBase + _bufferOffset); 518717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5188560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform3iv( 5189560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5190560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5191560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)v 5192560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 51932ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 51942ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5195560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 51963b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT); 5197560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 51982ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 51992ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 52002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5201560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5202560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5203560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */ 5204560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5205560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform4f__IFFFF 5206560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jfloat x, jfloat y, jfloat z, jfloat w) { 5207560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform4f( 5208560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5209560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)x, 5210560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)y, 5211560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)z, 5212560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)w 5213560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5214560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5215560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5216560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5217560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5218560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform4fv__II_3FI 5219560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jfloatArray v_ref, jint offset) { 52202545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 52212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 52222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5223560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v_base = (GLfloat *) 0; 5224560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5225560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v = (GLfloat *) 0; 5226560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5227560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!v_ref) { 52282545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 52292545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 52302545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "v == null"; 5231560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5232560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5233560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 52342545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 52352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 52362545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5237560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5238560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5239560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(v_ref) - offset; 52402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*4) { 52412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 52422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 52432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count*4 < needed"; 52442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 52452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5246560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v_base = (GLfloat *) 52473b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(v_ref, (jboolean *)0); 5248560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v = v_base + offset; 5249560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5250560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform4fv( 5251560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5252560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5253560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)v 5254560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5255560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5256560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5257560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (v_base) { 52583b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(v_ref, (jfloat*)v_base, 5259560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5260560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 52612545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 52622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 52632545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5264560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5265560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5266560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) */ 5267560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5268560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform4fv__IILjava_nio_FloatBuffer_2 5269560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 52702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 52712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 52722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 52733b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 527417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5275560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5276560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *v = (GLfloat *) 0; 5277560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 52783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi v = (GLfloat *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 52792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*4) { 52802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 52812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 52822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count*4 < needed"; 52832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 52842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 528517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (v == NULL) { 52863b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _vBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 528717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer v = (GLfloat *) (_vBase + _bufferOffset); 528817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5289560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform4fv( 5290560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5291560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5292560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)v 5293560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 52942ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 52952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5296560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 52973b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)v, JNI_ABORT); 5298560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 52992ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 53002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 53012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5302560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5303560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5304560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w ) */ 5305560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5306560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform4i__IIIII 5307560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint x, jint y, jint z, jint w) { 5308560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform4i( 5309560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5310560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)x, 5311560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)y, 5312560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)z, 5313560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)w 5314560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5315560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5316560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5317560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) */ 5318560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5319560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform4iv__II_3II 5320560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jintArray v_ref, jint offset) { 53212545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 53222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 53232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5324560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v_base = (GLint *) 0; 5325560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5326560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v = (GLint *) 0; 5327560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5328560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!v_ref) { 53292545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 53302545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 53312545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "v == null"; 5332560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5333560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5334560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 53352545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 53362545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 53372545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5338560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5339560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5340560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(v_ref) - offset; 53412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*4) { 53422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 53432ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 53442ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count*4 < needed"; 53452ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 53462ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5347560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v_base = (GLint *) 53483b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetIntArrayElements(v_ref, (jboolean *)0); 5349560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich v = v_base + offset; 5350560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5351560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform4iv( 5352560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5353560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5354560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)v 5355560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5356560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5357560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5358560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (v_base) { 53593b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(v_ref, (jint*)v_base, 5360560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5361560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 53622545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 53632545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 53642545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5365560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5366560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5367560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) */ 5368560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5369560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniform4iv__IILjava_nio_IntBuffer_2 5370560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jobject v_buf) { 53712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 53722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 53732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 53743b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jintArray _array = (jintArray) 0; 537517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5376560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5377560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLint *v = (GLint *) 0; 5378560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 53793b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 53802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*4) { 53812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 53822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 53832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count*4 < needed"; 53842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 53852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 538617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (v == NULL) { 53873b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0); 538817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer v = (GLint *) (_vBase + _bufferOffset); 538917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5390560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniform4iv( 5391560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5392560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5393560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint *)v 5394560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 53952ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 53962ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5397560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 53983b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT); 5399560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 54002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 54012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 54022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5403560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5404560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5405560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5406560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5407560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniformMatrix2fv__IIZ_3FI 5408560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { 54092545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 54102ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 54112ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5412560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *value_base = (GLfloat *) 0; 5413560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5414560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *value = (GLfloat *) 0; 5415560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5416560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!value_ref) { 54172545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 54182545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 54192545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "value == null"; 5420560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5421560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5422560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 54232545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 54242545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 54252545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5426560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5427560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5428560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(value_ref) - offset; 54292ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*4) { 54302ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 54312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 54322ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count*4 < needed"; 54332ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 54342ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5435560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich value_base = (GLfloat *) 54363b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(value_ref, (jboolean *)0); 5437560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich value = value_base + offset; 5438560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5439560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniformMatrix2fv( 5440560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5441560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5442560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)transpose, 5443560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)value 5444560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5445560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5446560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5447560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (value_base) { 54483b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base, 5449560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5450560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 54512545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 54522545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 54532545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5454560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5455560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5456560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5457560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5458560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2 5459560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { 54602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 54612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 54622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 54633b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 546417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5465560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5466560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *value = (GLfloat *) 0; 5467560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 54683b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 54692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*4) { 54702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 54712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 54722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count*4 < needed"; 54732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 54742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 547517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (value == NULL) { 54763b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 547717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer value = (GLfloat *) (_valueBase + _bufferOffset); 547817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5479560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniformMatrix2fv( 5480560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5481560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5482560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)transpose, 5483560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)value 5484560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 54852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 54862ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5487560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 54883b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT); 5489560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 54902ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 54912ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 54922ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5493560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5494560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5495560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5496560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5497560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniformMatrix3fv__IIZ_3FI 5498560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { 54992545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 55002ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 55012ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5502560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *value_base = (GLfloat *) 0; 5503560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5504560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *value = (GLfloat *) 0; 5505560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5506560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!value_ref) { 55072545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 55082545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 55092545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "value == null"; 5510560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5511560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5512560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 55132545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 55142545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 55152545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5516560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5517560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5518560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(value_ref) - offset; 55192ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*9) { 55202ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 55212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 55222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count*9 < needed"; 55232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 55242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5525560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich value_base = (GLfloat *) 55263b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(value_ref, (jboolean *)0); 5527560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich value = value_base + offset; 5528560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5529560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniformMatrix3fv( 5530560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5531560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5532560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)transpose, 5533560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)value 5534560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5535560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5536560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5537560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (value_base) { 55383b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base, 5539560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5540560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 55412545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 55422545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 55432545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5544560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5545560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5546560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5547560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5548560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2 5549560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { 55502ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 55512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 55522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 55533b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 555417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5555560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5556560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *value = (GLfloat *) 0; 5557560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 55583b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 55592ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*9) { 55602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 55612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 55622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count*9 < needed"; 55632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 55642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 556517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (value == NULL) { 55663b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 556717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer value = (GLfloat *) (_valueBase + _bufferOffset); 556817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5569560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniformMatrix3fv( 5570560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5571560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5572560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)transpose, 5573560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)value 5574560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 55752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 55762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5577560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 55783b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT); 5579560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 55802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 55812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 55822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5583560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5584560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5585560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5586560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5587560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniformMatrix4fv__IIZ_3FI 5588560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) { 55892545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 55902ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 55912ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5592560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *value_base = (GLfloat *) 0; 5593560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5594560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *value = (GLfloat *) 0; 5595560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5596560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!value_ref) { 55972545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 55982545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 55992545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "value == null"; 5600560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5601560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5602560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 56032545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 56042545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 56052545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5606560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5607560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5608560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(value_ref) - offset; 56092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*16) { 56102ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 56112ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 56122ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < count*16 < needed"; 56132ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 56142ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5615560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich value_base = (GLfloat *) 56163b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(value_ref, (jboolean *)0); 5617560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich value = value_base + offset; 5618560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5619560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniformMatrix4fv( 5620560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5621560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5622560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)transpose, 5623560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)value 5624560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5625560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5626560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5627560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (value_base) { 56283b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base, 5629560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5630560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 56312545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 56322545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 56332545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5634560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5635560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5636560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */ 5637560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5638560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2 5639560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) { 56402ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 56412ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 56422ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 56433b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 564417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5645560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5646560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *value = (GLfloat *) 0; 5647560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 56483b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 56492ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < count*16) { 56502ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 56512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 56522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < count*16 < needed"; 56532ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 56542ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 565517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (value == NULL) { 56563b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 565717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer value = (GLfloat *) (_valueBase + _bufferOffset); 565817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5659560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUniformMatrix4fv( 5660560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)location, 5661560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)count, 5662560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)transpose, 5663560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)value 5664560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 56652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 56662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5667560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 56683b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT); 5669560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 56702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 56712ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 56722ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5673560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5674560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5675560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glUseProgram ( GLuint program ) */ 5676560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5677560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glUseProgram__I 5678560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program) { 5679560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glUseProgram( 5680560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program 5681560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5682560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5683560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5684560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glValidateProgram ( GLuint program ) */ 5685560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5686560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glValidateProgram__I 5687560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint program) { 5688560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glValidateProgram( 5689560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)program 5690560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5691560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5692560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5693560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib1f ( GLuint indx, GLfloat x ) */ 5694560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5695560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib1f__IF 5696560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jfloat x) { 5697560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib1f( 5698560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5699560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)x 5700560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5701560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5702560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5703560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) */ 5704560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5705560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib1fv__I_3FI 5706560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { 57072545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 57082ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 57092ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5710560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values_base = (GLfloat *) 0; 5711560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5712560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values = (GLfloat *) 0; 5713560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5714560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!values_ref) { 57152545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 57162545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 57172545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "values == null"; 5718560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5719560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5720560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 57212545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 57222545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 57232545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5724560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5725560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5726560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(values_ref) - offset; 57272ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 57282ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 57292ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 57302ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < 1 < needed"; 57312ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 57322ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5733560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich values_base = (GLfloat *) 57343b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(values_ref, (jboolean *)0); 5735560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich values = values_base + offset; 5736560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5737560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib1fv( 5738560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5739560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)values 5740560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5741560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5742560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5743560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (values_base) { 57443b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(values_ref, (jfloat*)values_base, 5745560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5746560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 57472545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 57482545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 57492545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5750560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5751560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5752560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) */ 5753560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5754560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2 5755560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { 57562ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 57572ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 57582ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 57593b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 576017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5761560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5762560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values = (GLfloat *) 0; 5763560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 57643b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi values = (GLfloat *)getPointer(_env, values_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 57652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 1) { 57662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 57672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 57682ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 1 < needed"; 57692ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 57702ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 577117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (values == NULL) { 57723b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _valuesBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 577317045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer values = (GLfloat *) (_valuesBase + _bufferOffset); 577417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5775560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib1fv( 5776560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5777560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)values 5778560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 57792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 57802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5781560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 57823b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)values, JNI_ABORT); 5783560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 57842ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 57852ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 57862ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5787560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5788560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5789560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib2f ( GLuint indx, GLfloat x, GLfloat y ) */ 5790560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5791560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib2f__IFF 5792560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y) { 5793560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib2f( 5794560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5795560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)x, 5796560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)y 5797560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5798560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5799560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5800560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) */ 5801560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5802560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib2fv__I_3FI 5803560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { 58042545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 58052ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 58062ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5807560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values_base = (GLfloat *) 0; 5808560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5809560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values = (GLfloat *) 0; 5810560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5811560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!values_ref) { 58122545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 58132545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 58142545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "values == null"; 5815560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5816560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5817560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 58182545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 58192545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 58202545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5821560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5822560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5823560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(values_ref) - offset; 58242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 2) { 58252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 58262ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 58272ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < 2 < needed"; 58282ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 58292ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5830560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich values_base = (GLfloat *) 58313b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(values_ref, (jboolean *)0); 5832560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich values = values_base + offset; 5833560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5834560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib2fv( 5835560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5836560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)values 5837560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5838560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5839560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5840560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (values_base) { 58413b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(values_ref, (jfloat*)values_base, 5842560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5843560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 58442545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 58452545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 58462545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5847560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5848560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5849560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) */ 5850560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5851560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2 5852560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { 58532ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 58542ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 58552ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 58563b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 585717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5858560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5859560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values = (GLfloat *) 0; 5860560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 58613b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi values = (GLfloat *)getPointer(_env, values_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 58622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 2) { 58632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 58642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 58652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 2 < needed"; 58662ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 58672ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 586817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (values == NULL) { 58693b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _valuesBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 587017045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer values = (GLfloat *) (_valuesBase + _bufferOffset); 587117045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5872560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib2fv( 5873560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5874560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)values 5875560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 58762ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 58772ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5878560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 58793b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)values, JNI_ABORT); 5880560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 58812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 58822ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 58832ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5884560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5885560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5886560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) */ 5887560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5888560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib3f__IFFF 5889560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y, jfloat z) { 5890560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib3f( 5891560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5892560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)x, 5893560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)y, 5894560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)z 5895560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5896560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5897560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5898560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) */ 5899560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5900560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib3fv__I_3FI 5901560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { 59022545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 59032ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 59042ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 5905560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values_base = (GLfloat *) 0; 5906560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5907560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values = (GLfloat *) 0; 5908560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5909560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!values_ref) { 59102545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 59112545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 59122545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "values == null"; 5913560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5914560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5915560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 59162545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 59172545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 59182545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 5919560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 5920560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 5921560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(values_ref) - offset; 59222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 3) { 59232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 59242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 59252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < 3 < needed"; 59262ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 59272ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5928560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich values_base = (GLfloat *) 59293b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(values_ref, (jboolean *)0); 5930560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich values = values_base + offset; 5931560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5932560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib3fv( 5933560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5934560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)values 5935560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5936560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5937560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 5938560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (values_base) { 59393b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(values_ref, (jfloat*)values_base, 5940560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 5941560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 59422545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 59432545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 59442545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 5945560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5946560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5947560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) */ 5948560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5949560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2 5950560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { 59512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 59522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 59532ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 59543b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 595517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 5956560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 5957560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values = (GLfloat *) 0; 5958560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 59593b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi values = (GLfloat *)getPointer(_env, values_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 59602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 3) { 59612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 59622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 59632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 3 < needed"; 59642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 59652ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 596617045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (values == NULL) { 59673b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _valuesBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 596817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer values = (GLfloat *) (_valuesBase + _bufferOffset); 596917045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 5970560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib3fv( 5971560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5972560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)values 5973560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 59742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 59752ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 5976560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 59773b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)values, JNI_ABORT); 5978560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 59792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 59802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 59812ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 5982560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5983560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5984560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) */ 5985560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5986560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib4f__IFFFF 5987560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jfloat x, jfloat y, jfloat z, jfloat w) { 5988560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib4f( 5989560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 5990560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)x, 5991560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)y, 5992560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)z, 5993560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat)w 5994560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 5995560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 5996560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 5997560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) */ 5998560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 5999560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib4fv__I_3FI 6000560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jfloatArray values_ref, jint offset) { 60012545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jint _exception = 0; 60022ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 60032ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 6004560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values_base = (GLfloat *) 0; 6005560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 6006560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values = (GLfloat *) 0; 6007560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6008560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (!values_ref) { 60092545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 60102545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 60112545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "values == null"; 6012560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 6013560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 6014560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (offset < 0) { 60152545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exception = 1; 60162545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionType = "java/lang/IllegalArgumentException"; 60172545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer _exceptionMessage = "offset < 0"; 6018560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich goto exit; 6019560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 6020560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich _remaining = _env->GetArrayLength(values_ref) - offset; 60212ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 4) { 60222ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 60232ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 60242ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "length - offset < 4 < needed"; 60252ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 60262ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 6027560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich values_base = (GLfloat *) 60283b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->GetFloatArrayElements(values_ref, (jboolean *)0); 6029560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich values = values_base + offset; 6030560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6031560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib4fv( 6032560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 6033560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)values 6034560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 6035560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6036560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichexit: 6037560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (values_base) { 60383b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(values_ref, (jfloat*)values_base, 6039560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich JNI_ABORT); 6040560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 60412545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer if (_exception) { 60422545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer jniThrowException(_env, _exceptionType, _exceptionMessage); 60432545b32ced69100fe70685b95315c6adf411083bThomas Tafertshofer } 6044560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 6045560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6046560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) */ 6047560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 6048560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2 6049560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jobject values_buf) { 60502ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jint _exception = 0; 60512ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionType = NULL; 60522ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian const char * _exceptionMessage = NULL; 60533b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi jfloatArray _array = (jfloatArray) 0; 605417045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 6055560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 6056560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLfloat *values = (GLfloat *) 0; 6057560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 60583b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi values = (GLfloat *)getPointer(_env, values_buf, (jarray*)&_array, &_remaining, &_bufferOffset); 60592ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_remaining < 4) { 60602ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exception = 1; 60612ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionType = "java/lang/IllegalArgumentException"; 60622ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian _exceptionMessage = "remaining() < 4 < needed"; 60632ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian goto exit; 60642ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 606517045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer if (values == NULL) { 60663b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi char * _valuesBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0); 606717045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer values = (GLfloat *) (_valuesBase + _bufferOffset); 606817045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer } 6069560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttrib4fv( 6070560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 6071560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLfloat *)values 6072560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 60732ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian 60742ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopianexit: 6075560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (_array) { 60763b1d46e809ed38cd5662c110c511b8d98868ed72Hiroshi Yamauchi _env->ReleaseFloatArrayElements(_array, (jfloat*)values, JNI_ABORT); 6077560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 60782ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian if (_exception) { 60792ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian jniThrowException(_env, _exceptionType, _exceptionMessage); 60802ad0477f16c64dc3126741933f11e27353521bb4Mathias Agopian } 6081560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 6082560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6083224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich/* void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) */ 6084224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevichstatic void 6085224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevichandroid_glVertexAttribPointer__IIIZII 6086224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (JNIEnv *_env, jobject _this, jint indx, jint size, jint type, jboolean normalized, jint stride, jint offset) { 6087224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich glVertexAttribPointer( 6088224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (GLuint)indx, 6089224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (GLint)size, 6090224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (GLenum)type, 6091224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (GLboolean)normalized, 6092224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich (GLsizei)stride, 609301c26ea89d4bbea3cf550e9328742302dd9a2b25Ashok Bhat reinterpret_cast<GLvoid *>(offset) 6094224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich ); 6095224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich} 6096224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich 6097560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr ) */ 6098560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 6099560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glVertexAttribPointerBounds__IIIZILjava_nio_Buffer_2I 6100560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint indx, jint size, jint type, jboolean normalized, jint stride, jobject ptr_buf, jint remaining) { 6101560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jarray _array = (jarray) 0; 610217045a16575ece34cfadb63da4791f115625df78Thomas Tafertshofer jint _bufferOffset = (jint) 0; 6103560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich jint _remaining; 6104560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich GLvoid *ptr = (GLvoid *) 0; 6105560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6106560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if (ptr_buf) { 6107560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ptr = (GLvoid *) getDirectBufferPointer(_env, ptr_buf); 6108560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich if ( ! ptr ) { 6109560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich return; 6110560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 6111560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich } 6112560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glVertexAttribPointerBounds( 6113560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLuint)indx, 6114560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)size, 6115560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLenum)type, 6116560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLboolean)normalized, 6117560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)stride, 6118560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLvoid *)ptr, 6119560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)remaining 6120560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 6121560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 6122560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6123560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich/* void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) */ 6124560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic void 6125560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichandroid_glViewport__IIII 6126560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height) { 6127560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich glViewport( 6128560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)x, 6129560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLint)y, 6130560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)width, 6131560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich (GLsizei)height 6132560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich ); 6133560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 6134560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6135560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichstatic const char *classPathName = "android/opengl/GLES20"; 6136560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 613776f6a86de25e1bf74717e047e55fd44b089673f3Daniel Micaystatic const JNINativeMethod methods[] = { 6138560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"_nativeClassInit", "()V", (void*)nativeClassInit }, 6139560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glActiveTexture", "(I)V", (void *) android_glActiveTexture__I }, 6140560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glAttachShader", "(II)V", (void *) android_glAttachShader__II }, 6141560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBindAttribLocation", "(IILjava/lang/String;)V", (void *) android_glBindAttribLocation__IILjava_lang_String_2 }, 6142560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBindBuffer", "(II)V", (void *) android_glBindBuffer__II }, 6143560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBindFramebuffer", "(II)V", (void *) android_glBindFramebuffer__II }, 6144560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBindRenderbuffer", "(II)V", (void *) android_glBindRenderbuffer__II }, 6145560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBindTexture", "(II)V", (void *) android_glBindTexture__II }, 6146560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBlendColor", "(FFFF)V", (void *) android_glBlendColor__FFFF }, 6147560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBlendEquation", "(I)V", (void *) android_glBlendEquation__I }, 6148560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBlendEquationSeparate", "(II)V", (void *) android_glBlendEquationSeparate__II }, 6149560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBlendFunc", "(II)V", (void *) android_glBlendFunc__II }, 6150560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBlendFuncSeparate", "(IIII)V", (void *) android_glBlendFuncSeparate__IIII }, 6151560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBufferData", "(IILjava/nio/Buffer;I)V", (void *) android_glBufferData__IILjava_nio_Buffer_2I }, 6152560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glBufferSubData", "(IIILjava/nio/Buffer;)V", (void *) android_glBufferSubData__IIILjava_nio_Buffer_2 }, 6153560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glCheckFramebufferStatus", "(I)I", (void *) android_glCheckFramebufferStatus__I }, 6154560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glClear", "(I)V", (void *) android_glClear__I }, 6155560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glClearColor", "(FFFF)V", (void *) android_glClearColor__FFFF }, 6156560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glClearDepthf", "(F)V", (void *) android_glClearDepthf__F }, 6157560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glClearStencil", "(I)V", (void *) android_glClearStencil__I }, 6158560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glColorMask", "(ZZZZ)V", (void *) android_glColorMask__ZZZZ }, 6159560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glCompileShader", "(I)V", (void *) android_glCompileShader__I }, 6160560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glCompressedTexImage2D", "(IIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage2D__IIIIIIILjava_nio_Buffer_2 }, 6161560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glCompressedTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, 6162560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glCopyTexImage2D", "(IIIIIIII)V", (void *) android_glCopyTexImage2D__IIIIIIII }, 6163560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glCopyTexSubImage2D", "(IIIIIIII)V", (void *) android_glCopyTexSubImage2D__IIIIIIII }, 6164560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glCreateProgram", "()I", (void *) android_glCreateProgram__ }, 6165560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glCreateShader", "(I)I", (void *) android_glCreateShader__I }, 6166560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glCullFace", "(I)V", (void *) android_glCullFace__I }, 6167560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteBuffers", "(I[II)V", (void *) android_glDeleteBuffers__I_3II }, 6168560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteBuffers__ILjava_nio_IntBuffer_2 }, 6169560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteFramebuffers", "(I[II)V", (void *) android_glDeleteFramebuffers__I_3II }, 6170560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteFramebuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteFramebuffers__ILjava_nio_IntBuffer_2 }, 6171560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteProgram", "(I)V", (void *) android_glDeleteProgram__I }, 6172560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteRenderbuffers", "(I[II)V", (void *) android_glDeleteRenderbuffers__I_3II }, 6173560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteRenderbuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteRenderbuffers__ILjava_nio_IntBuffer_2 }, 6174560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteShader", "(I)V", (void *) android_glDeleteShader__I }, 6175560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteTextures", "(I[II)V", (void *) android_glDeleteTextures__I_3II }, 6176560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDeleteTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTextures__ILjava_nio_IntBuffer_2 }, 6177560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDepthFunc", "(I)V", (void *) android_glDepthFunc__I }, 6178560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDepthMask", "(Z)V", (void *) android_glDepthMask__Z }, 6179560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDepthRangef", "(FF)V", (void *) android_glDepthRangef__FF }, 6180560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDetachShader", "(II)V", (void *) android_glDetachShader__II }, 6181560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDisable", "(I)V", (void *) android_glDisable__I }, 6182560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDisableVertexAttribArray", "(I)V", (void *) android_glDisableVertexAttribArray__I }, 6183560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDrawArrays", "(III)V", (void *) android_glDrawArrays__III }, 6184224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich{"glDrawElements", "(IIII)V", (void *) android_glDrawElements__IIII }, 6185560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glDrawElements", "(IIILjava/nio/Buffer;)V", (void *) android_glDrawElements__IIILjava_nio_Buffer_2 }, 6186560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glEnable", "(I)V", (void *) android_glEnable__I }, 6187560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glEnableVertexAttribArray", "(I)V", (void *) android_glEnableVertexAttribArray__I }, 6188560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glFinish", "()V", (void *) android_glFinish__ }, 6189560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glFlush", "()V", (void *) android_glFlush__ }, 6190560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glFramebufferRenderbuffer", "(IIII)V", (void *) android_glFramebufferRenderbuffer__IIII }, 6191560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glFramebufferTexture2D", "(IIIII)V", (void *) android_glFramebufferTexture2D__IIIII }, 6192560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glFrontFace", "(I)V", (void *) android_glFrontFace__I }, 6193560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGenBuffers", "(I[II)V", (void *) android_glGenBuffers__I_3II }, 6194560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGenBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenBuffers__ILjava_nio_IntBuffer_2 }, 6195560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGenerateMipmap", "(I)V", (void *) android_glGenerateMipmap__I }, 6196560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGenFramebuffers", "(I[II)V", (void *) android_glGenFramebuffers__I_3II }, 6197560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGenFramebuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenFramebuffers__ILjava_nio_IntBuffer_2 }, 6198560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGenRenderbuffers", "(I[II)V", (void *) android_glGenRenderbuffers__I_3II }, 6199560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGenRenderbuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenRenderbuffers__ILjava_nio_IntBuffer_2 }, 6200560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGenTextures", "(I[II)V", (void *) android_glGenTextures__I_3II }, 6201560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGenTextures", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTextures__ILjava_nio_IntBuffer_2 }, 6202560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetActiveAttrib", "(III[II[II[II[BI)V", (void *) android_glGetActiveAttrib__III_3II_3II_3II_3BI }, 6203560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetActiveAttrib", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveAttrib__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B }, 6204dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer{"glGetActiveAttrib", "(II[II[II)Ljava/lang/String;", (void *) android_glGetActiveAttrib1 }, 6205dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer{"glGetActiveAttrib", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetActiveAttrib2 }, 6206560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetActiveUniform", "(III[II[II[II[BI)V", (void *) android_glGetActiveUniform__III_3II_3II_3II_3BI }, 6207dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer{"glGetActiveUniform", "(II[II[II)Ljava/lang/String;", (void *) android_glGetActiveUniform1 }, 6208560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetActiveUniform", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetActiveUniform__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B }, 6209dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer{"glGetActiveUniform", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetActiveUniform2 }, 6210560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetAttachedShaders", "(II[II[II)V", (void *) android_glGetAttachedShaders__II_3II_3II }, 6211560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetAttachedShaders", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetAttachedShaders__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, 6212560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetAttribLocation", "(ILjava/lang/String;)I", (void *) android_glGetAttribLocation__ILjava_lang_String_2 }, 6213560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetBooleanv", "(I[ZI)V", (void *) android_glGetBooleanv__I_3ZI }, 6214560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetBooleanv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetBooleanv__ILjava_nio_IntBuffer_2 }, 6215560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetBufferParameteriv", "(II[II)V", (void *) android_glGetBufferParameteriv__II_3II }, 6216560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetBufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBufferParameteriv__IILjava_nio_IntBuffer_2 }, 6217560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetError", "()I", (void *) android_glGetError__ }, 6218560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetFloatv", "(I[FI)V", (void *) android_glGetFloatv__I_3FI }, 6219560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetFloatv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glGetFloatv__ILjava_nio_FloatBuffer_2 }, 6220560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetFramebufferAttachmentParameteriv", "(III[II)V", (void *) android_glGetFramebufferAttachmentParameteriv__III_3II }, 6221560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetFramebufferAttachmentParameteriv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferAttachmentParameteriv__IIILjava_nio_IntBuffer_2 }, 6222560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetIntegerv", "(I[II)V", (void *) android_glGetIntegerv__I_3II }, 6223560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void *) android_glGetIntegerv__ILjava_nio_IntBuffer_2 }, 6224560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetProgramiv", "(II[II)V", (void *) android_glGetProgramiv__II_3II }, 6225560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetProgramiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetProgramiv__IILjava_nio_IntBuffer_2 }, 6226560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetProgramInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetProgramInfoLog }, 6227560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetRenderbufferParameteriv", "(II[II)V", (void *) android_glGetRenderbufferParameteriv__II_3II }, 6228560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetRenderbufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetRenderbufferParameteriv__IILjava_nio_IntBuffer_2 }, 6229560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetShaderiv", "(II[II)V", (void *) android_glGetShaderiv__II_3II }, 6230560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetShaderiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetShaderiv__IILjava_nio_IntBuffer_2 }, 6231560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetShaderInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetShaderInfoLog }, 6232560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetShaderPrecisionFormat", "(II[II[II)V", (void *) android_glGetShaderPrecisionFormat__II_3II_3II }, 6233560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetShaderPrecisionFormat", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetShaderPrecisionFormat__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 }, 6234560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetShaderSource", "(II[II[BI)V", (void *) android_glGetShaderSource__II_3II_3BI }, 6235560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetShaderSource", "(IILjava/nio/IntBuffer;B)V", (void *) android_glGetShaderSource__IILjava_nio_IntBuffer_2B }, 6236dd06946252be852aa53eb6142a119b0fccc83cd1Thomas Tafertshofer{"glGetShaderSource", "(I)Ljava/lang/String;", (void *) android_glGetShaderSource }, 6237560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetString", "(I)Ljava/lang/String;", (void *) android_glGetString }, 6238560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetTexParameterfv", "(II[FI)V", (void *) android_glGetTexParameterfv__II_3FI }, 6239560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetTexParameterfv__IILjava_nio_FloatBuffer_2 }, 6240560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetTexParameteriv", "(II[II)V", (void *) android_glGetTexParameteriv__II_3II }, 6241560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameteriv__IILjava_nio_IntBuffer_2 }, 6242560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetUniformfv", "(II[FI)V", (void *) android_glGetUniformfv__II_3FI }, 6243560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetUniformfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetUniformfv__IILjava_nio_FloatBuffer_2 }, 6244560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetUniformiv", "(II[II)V", (void *) android_glGetUniformiv__II_3II }, 6245560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetUniformiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformiv__IILjava_nio_IntBuffer_2 }, 6246560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetUniformLocation", "(ILjava/lang/String;)I", (void *) android_glGetUniformLocation__ILjava_lang_String_2 }, 6247560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetVertexAttribfv", "(II[FI)V", (void *) android_glGetVertexAttribfv__II_3FI }, 6248560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetVertexAttribfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetVertexAttribfv__IILjava_nio_FloatBuffer_2 }, 6249560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetVertexAttribiv", "(II[II)V", (void *) android_glGetVertexAttribiv__II_3II }, 6250560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glGetVertexAttribiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribiv__IILjava_nio_IntBuffer_2 }, 6251560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glHint", "(II)V", (void *) android_glHint__II }, 6252560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glIsBuffer", "(I)Z", (void *) android_glIsBuffer__I }, 6253560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glIsEnabled", "(I)Z", (void *) android_glIsEnabled__I }, 6254560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glIsFramebuffer", "(I)Z", (void *) android_glIsFramebuffer__I }, 6255560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glIsProgram", "(I)Z", (void *) android_glIsProgram__I }, 6256560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glIsRenderbuffer", "(I)Z", (void *) android_glIsRenderbuffer__I }, 6257560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glIsShader", "(I)Z", (void *) android_glIsShader__I }, 6258560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glIsTexture", "(I)Z", (void *) android_glIsTexture__I }, 6259560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glLineWidth", "(F)V", (void *) android_glLineWidth__F }, 6260560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glLinkProgram", "(I)V", (void *) android_glLinkProgram__I }, 6261560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glPixelStorei", "(II)V", (void *) android_glPixelStorei__II }, 6262560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glPolygonOffset", "(FF)V", (void *) android_glPolygonOffset__FF }, 6263560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glReadPixels", "(IIIIIILjava/nio/Buffer;)V", (void *) android_glReadPixels__IIIIIILjava_nio_Buffer_2 }, 6264560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glReleaseShaderCompiler", "()V", (void *) android_glReleaseShaderCompiler__ }, 6265560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glRenderbufferStorage", "(IIII)V", (void *) android_glRenderbufferStorage__IIII }, 6266560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glSampleCoverage", "(FZ)V", (void *) android_glSampleCoverage__FZ }, 6267560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glScissor", "(IIII)V", (void *) android_glScissor__IIII }, 6268560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glShaderBinary", "(I[IIILjava/nio/Buffer;I)V", (void *) android_glShaderBinary__I_3IIILjava_nio_Buffer_2I }, 6269560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glShaderBinary", "(ILjava/nio/IntBuffer;ILjava/nio/Buffer;I)V", (void *) android_glShaderBinary__ILjava_nio_IntBuffer_2ILjava_nio_Buffer_2I }, 6270560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glShaderSource", "(ILjava/lang/String;)V", (void *) android_glShaderSource }, 6271560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glStencilFunc", "(III)V", (void *) android_glStencilFunc__III }, 6272560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glStencilFuncSeparate", "(IIII)V", (void *) android_glStencilFuncSeparate__IIII }, 6273560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glStencilMask", "(I)V", (void *) android_glStencilMask__I }, 6274560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glStencilMaskSeparate", "(II)V", (void *) android_glStencilMaskSeparate__II }, 6275560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glStencilOp", "(III)V", (void *) android_glStencilOp__III }, 6276560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glStencilOpSeparate", "(IIII)V", (void *) android_glStencilOpSeparate__IIII }, 6277560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glTexImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage2D__IIIIIIIILjava_nio_Buffer_2 }, 6278560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glTexParameterf", "(IIF)V", (void *) android_glTexParameterf__IIF }, 6279560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glTexParameterfv", "(II[FI)V", (void *) android_glTexParameterfv__II_3FI }, 6280560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glTexParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glTexParameterfv__IILjava_nio_FloatBuffer_2 }, 6281560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glTexParameteri", "(III)V", (void *) android_glTexParameteri__III }, 6282560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glTexParameteriv", "(II[II)V", (void *) android_glTexParameteriv__II_3II }, 6283560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glTexParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameteriv__IILjava_nio_IntBuffer_2 }, 6284560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glTexSubImage2D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage2D__IIIIIIIILjava_nio_Buffer_2 }, 6285560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform1f", "(IF)V", (void *) android_glUniform1f__IF }, 6286560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform1fv", "(II[FI)V", (void *) android_glUniform1fv__II_3FI }, 6287560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform1fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform1fv__IILjava_nio_FloatBuffer_2 }, 6288560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform1i", "(II)V", (void *) android_glUniform1i__II }, 6289560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform1iv", "(II[II)V", (void *) android_glUniform1iv__II_3II }, 6290560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform1iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1iv__IILjava_nio_IntBuffer_2 }, 6291560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform2f", "(IFF)V", (void *) android_glUniform2f__IFF }, 6292560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform2fv", "(II[FI)V", (void *) android_glUniform2fv__II_3FI }, 6293560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform2fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform2fv__IILjava_nio_FloatBuffer_2 }, 6294560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform2i", "(III)V", (void *) android_glUniform2i__III }, 6295560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform2iv", "(II[II)V", (void *) android_glUniform2iv__II_3II }, 6296560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform2iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2iv__IILjava_nio_IntBuffer_2 }, 6297560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform3f", "(IFFF)V", (void *) android_glUniform3f__IFFF }, 6298560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform3fv", "(II[FI)V", (void *) android_glUniform3fv__II_3FI }, 6299560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform3fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform3fv__IILjava_nio_FloatBuffer_2 }, 6300560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform3i", "(IIII)V", (void *) android_glUniform3i__IIII }, 6301560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform3iv", "(II[II)V", (void *) android_glUniform3iv__II_3II }, 6302560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform3iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3iv__IILjava_nio_IntBuffer_2 }, 6303560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform4f", "(IFFFF)V", (void *) android_glUniform4f__IFFFF }, 6304560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform4fv", "(II[FI)V", (void *) android_glUniform4fv__II_3FI }, 6305560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform4fv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glUniform4fv__IILjava_nio_FloatBuffer_2 }, 6306560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform4i", "(IIIII)V", (void *) android_glUniform4i__IIIII }, 6307560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform4iv", "(II[II)V", (void *) android_glUniform4iv__II_3II }, 6308560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniform4iv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4iv__IILjava_nio_IntBuffer_2 }, 6309560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniformMatrix2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2fv__IIZ_3FI }, 6310560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniformMatrix2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2fv__IIZLjava_nio_FloatBuffer_2 }, 6311560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniformMatrix3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3fv__IIZ_3FI }, 6312560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniformMatrix3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3fv__IIZLjava_nio_FloatBuffer_2 }, 6313560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniformMatrix4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4fv__IIZ_3FI }, 6314560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUniformMatrix4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4fv__IIZLjava_nio_FloatBuffer_2 }, 6315560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glUseProgram", "(I)V", (void *) android_glUseProgram__I }, 6316560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glValidateProgram", "(I)V", (void *) android_glValidateProgram__I }, 6317560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib1f", "(IF)V", (void *) android_glVertexAttrib1f__IF }, 6318560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib1fv", "(I[FI)V", (void *) android_glVertexAttrib1fv__I_3FI }, 6319560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib1fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib1fv__ILjava_nio_FloatBuffer_2 }, 6320560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib2f", "(IFF)V", (void *) android_glVertexAttrib2f__IFF }, 6321560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib2fv", "(I[FI)V", (void *) android_glVertexAttrib2fv__I_3FI }, 6322560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib2fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib2fv__ILjava_nio_FloatBuffer_2 }, 6323560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib3f", "(IFFF)V", (void *) android_glVertexAttrib3f__IFFF }, 6324560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib3fv", "(I[FI)V", (void *) android_glVertexAttrib3fv__I_3FI }, 6325560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib3fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib3fv__ILjava_nio_FloatBuffer_2 }, 6326560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib4f", "(IFFFF)V", (void *) android_glVertexAttrib4f__IFFFF }, 6327560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib4fv", "(I[FI)V", (void *) android_glVertexAttrib4fv__I_3FI }, 6328560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttrib4fv", "(ILjava/nio/FloatBuffer;)V", (void *) android_glVertexAttrib4fv__ILjava_nio_FloatBuffer_2 }, 6329224107a421e2611b15d1ec736df54bca9ee3e78dJack Palevich{"glVertexAttribPointer", "(IIIZII)V", (void *) android_glVertexAttribPointer__IIIZII }, 6330560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glVertexAttribPointerBounds", "(IIIZILjava/nio/Buffer;I)V", (void *) android_glVertexAttribPointerBounds__IIIZILjava_nio_Buffer_2I }, 6331560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{"glViewport", "(IIII)V", (void *) android_glViewport__IIII }, 6332560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich}; 6333560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich 6334560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevichint register_android_opengl_jni_GLES20(JNIEnv *_env) 6335560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich{ 6336560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich int err; 6337560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); 6338560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich return err; 6339560814f6b11abe83ff0c4ed18cac015c276b3181Jack Palevich} 6340