PageRenderTime 42ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/core/jni/android_opengl_GLES30.cpp

http://github.com/CyanogenMod/android_frameworks_base
C++ | 5363 lines | 4722 code | 437 blank | 204 comment | 477 complexity | dae2aa21535ace3b479da85ff91c5111 MD5 | raw file
Possible License(s): LGPL-2.1, MPL-2.0-no-copyleft-exception, CC0-1.0, BitTorrent-1.0, BSD-3-Clause
  1. /*
  2. **
  3. ** Copyright 2013, The Android Open Source Project
  4. **
  5. ** Licensed under the Apache License, Version 2.0 (the "License");
  6. ** you may not use this file except in compliance with the License.
  7. ** You may obtain a copy of the License at
  8. **
  9. ** http://www.apache.org/licenses/LICENSE-2.0
  10. **
  11. ** Unless required by applicable law or agreed to in writing, software
  12. ** distributed under the License is distributed on an "AS IS" BASIS,
  13. ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. ** See the License for the specific language governing permissions and
  15. ** limitations under the License.
  16. */
  17. // This source file is automatically generated
  18. #pragma GCC diagnostic ignored "-Wunused-variable"
  19. #pragma GCC diagnostic ignored "-Wunused-but-set-variable"
  20. #pragma GCC diagnostic ignored "-Wunused-function"
  21. #include <GLES3/gl3.h>
  22. #include <GLES3/gl3ext.h>
  23. #include <jni.h>
  24. #include <JNIHelp.h>
  25. #include <android_runtime/AndroidRuntime.h>
  26. #include <utils/misc.h>
  27. #include <assert.h>
  28. static int initialized = 0;
  29. static jclass nioAccessClass;
  30. static jclass bufferClass;
  31. static jmethodID getBasePointerID;
  32. static jmethodID getBaseArrayID;
  33. static jmethodID getBaseArrayOffsetID;
  34. static jfieldID positionID;
  35. static jfieldID limitID;
  36. static jfieldID elementSizeShiftID;
  37. /* special calls implemented in Android's GLES wrapper used to more
  38. * efficiently bound-check passed arrays */
  39. extern "C" {
  40. #ifdef GL_VERSION_ES_CM_1_1
  41. GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
  42. const GLvoid *ptr, GLsizei count);
  43. GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
  44. const GLvoid *pointer, GLsizei count);
  45. GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
  46. GLsizei stride, const GLvoid *pointer, GLsizei count);
  47. GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
  48. GLsizei stride, const GLvoid *pointer, GLsizei count);
  49. GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
  50. GLsizei stride, const GLvoid *pointer, GLsizei count);
  51. GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
  52. GLsizei stride, const GLvoid *pointer, GLsizei count);
  53. GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
  54. GLsizei stride, const GLvoid *pointer, GLsizei count);
  55. #endif
  56. #ifdef GL_ES_VERSION_2_0
  57. static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
  58. GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
  59. glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
  60. }
  61. #endif
  62. #ifdef GL_ES_VERSION_3_0
  63. static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
  64. GLsizei stride, const GLvoid *pointer, GLsizei count) {
  65. glVertexAttribIPointer(indx, size, type, stride, pointer);
  66. }
  67. #endif
  68. }
  69. /* Cache method IDs each time the class is loaded. */
  70. static void
  71. nativeClassInit(JNIEnv *_env, jclass glImplClass)
  72. {
  73. jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
  74. nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
  75. jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
  76. bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
  77. getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
  78. "getBasePointer", "(Ljava/nio/Buffer;)J");
  79. getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
  80. "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
  81. getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
  82. "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
  83. positionID = _env->GetFieldID(bufferClass, "position", "I");
  84. limitID = _env->GetFieldID(bufferClass, "limit", "I");
  85. elementSizeShiftID =
  86. _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
  87. }
  88. static void *
  89. getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
  90. {
  91. jint position;
  92. jint limit;
  93. jint elementSizeShift;
  94. jlong pointer;
  95. position = _env->GetIntField(buffer, positionID);
  96. limit = _env->GetIntField(buffer, limitID);
  97. elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
  98. *remaining = (limit - position) << elementSizeShift;
  99. pointer = _env->CallStaticLongMethod(nioAccessClass,
  100. getBasePointerID, buffer);
  101. if (pointer != 0L) {
  102. *array = NULL;
  103. return reinterpret_cast<void*>(pointer);
  104. }
  105. *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
  106. getBaseArrayID, buffer);
  107. *offset = _env->CallStaticIntMethod(nioAccessClass,
  108. getBaseArrayOffsetID, buffer);
  109. return NULL;
  110. }
  111. class ByteArrayGetter {
  112. public:
  113. static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
  114. return _env->GetByteArrayElements(array, is_copy);
  115. }
  116. };
  117. class BooleanArrayGetter {
  118. public:
  119. static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
  120. return _env->GetBooleanArrayElements(array, is_copy);
  121. }
  122. };
  123. class CharArrayGetter {
  124. public:
  125. static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
  126. return _env->GetCharArrayElements(array, is_copy);
  127. }
  128. };
  129. class ShortArrayGetter {
  130. public:
  131. static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
  132. return _env->GetShortArrayElements(array, is_copy);
  133. }
  134. };
  135. class IntArrayGetter {
  136. public:
  137. static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
  138. return _env->GetIntArrayElements(array, is_copy);
  139. }
  140. };
  141. class LongArrayGetter {
  142. public:
  143. static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
  144. return _env->GetLongArrayElements(array, is_copy);
  145. }
  146. };
  147. class FloatArrayGetter {
  148. public:
  149. static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
  150. return _env->GetFloatArrayElements(array, is_copy);
  151. }
  152. };
  153. class DoubleArrayGetter {
  154. public:
  155. static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
  156. return _env->GetDoubleArrayElements(array, is_copy);
  157. }
  158. };
  159. template<typename JTYPEARRAY, typename ARRAYGETTER>
  160. static void*
  161. getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
  162. return ARRAYGETTER::Get(_env, array, is_copy);
  163. }
  164. class ByteArrayReleaser {
  165. public:
  166. static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
  167. _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
  168. }
  169. };
  170. class BooleanArrayReleaser {
  171. public:
  172. static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
  173. _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
  174. }
  175. };
  176. class CharArrayReleaser {
  177. public:
  178. static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
  179. _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
  180. }
  181. };
  182. class ShortArrayReleaser {
  183. public:
  184. static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
  185. _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
  186. }
  187. };
  188. class IntArrayReleaser {
  189. public:
  190. static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
  191. _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
  192. }
  193. };
  194. class LongArrayReleaser {
  195. public:
  196. static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
  197. _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
  198. }
  199. };
  200. class FloatArrayReleaser {
  201. public:
  202. static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
  203. _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
  204. }
  205. };
  206. class DoubleArrayReleaser {
  207. public:
  208. static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
  209. _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
  210. }
  211. };
  212. template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
  213. static void
  214. releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
  215. ARRAYRELEASER::Release(_env, array, data, commit);
  216. }
  217. static void
  218. releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
  219. {
  220. _env->ReleasePrimitiveArrayCritical(array, data,
  221. commit ? 0 : JNI_ABORT);
  222. }
  223. static void *
  224. getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
  225. char* buf = (char*) _env->GetDirectBufferAddress(buffer);
  226. if (buf) {
  227. jint position = _env->GetIntField(buffer, positionID);
  228. jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
  229. buf += position << elementSizeShift;
  230. } else {
  231. jniThrowException(_env, "java/lang/IllegalArgumentException",
  232. "Must use a native order direct Buffer");
  233. }
  234. return (void*) buf;
  235. }
  236. // --------------------------------------------------------------------------
  237. /*
  238. * returns the number of values glGet returns for a given pname.
  239. *
  240. * The code below is written such that pnames requiring only one values
  241. * are the default (and are not explicitely tested for). This makes the
  242. * checking code much shorter/readable/efficient.
  243. *
  244. * This means that unknown pnames (e.g.: extensions) will default to 1. If
  245. * that unknown pname needs more than 1 value, then the validation check
  246. * is incomplete and the app may crash if it passed the wrong number params.
  247. */
  248. static int getNeededCount(GLint pname) {
  249. int needed = 1;
  250. #ifdef GL_ES_VERSION_2_0
  251. // GLES 2.x pnames
  252. switch (pname) {
  253. case GL_ALIASED_LINE_WIDTH_RANGE:
  254. case GL_ALIASED_POINT_SIZE_RANGE:
  255. needed = 2;
  256. break;
  257. case GL_BLEND_COLOR:
  258. case GL_COLOR_CLEAR_VALUE:
  259. case GL_COLOR_WRITEMASK:
  260. case GL_SCISSOR_BOX:
  261. case GL_VIEWPORT:
  262. needed = 4;
  263. break;
  264. case GL_COMPRESSED_TEXTURE_FORMATS:
  265. glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
  266. break;
  267. case GL_SHADER_BINARY_FORMATS:
  268. glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
  269. break;
  270. }
  271. #endif
  272. #ifdef GL_VERSION_ES_CM_1_1
  273. // GLES 1.x pnames
  274. switch (pname) {
  275. case GL_ALIASED_LINE_WIDTH_RANGE:
  276. case GL_ALIASED_POINT_SIZE_RANGE:
  277. case GL_DEPTH_RANGE:
  278. case GL_SMOOTH_LINE_WIDTH_RANGE:
  279. case GL_SMOOTH_POINT_SIZE_RANGE:
  280. needed = 2;
  281. break;
  282. case GL_CURRENT_NORMAL:
  283. case GL_POINT_DISTANCE_ATTENUATION:
  284. needed = 3;
  285. break;
  286. case GL_COLOR_CLEAR_VALUE:
  287. case GL_COLOR_WRITEMASK:
  288. case GL_CURRENT_COLOR:
  289. case GL_CURRENT_TEXTURE_COORDS:
  290. case GL_FOG_COLOR:
  291. case GL_LIGHT_MODEL_AMBIENT:
  292. case GL_SCISSOR_BOX:
  293. case GL_VIEWPORT:
  294. needed = 4;
  295. break;
  296. case GL_MODELVIEW_MATRIX:
  297. case GL_PROJECTION_MATRIX:
  298. case GL_TEXTURE_MATRIX:
  299. needed = 16;
  300. break;
  301. case GL_COMPRESSED_TEXTURE_FORMATS:
  302. glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
  303. break;
  304. }
  305. #endif
  306. return needed;
  307. }
  308. template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
  309. typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
  310. static void
  311. get
  312. (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
  313. jint _exception = 0;
  314. const char * _exceptionType;
  315. const char * _exceptionMessage;
  316. CTYPE *params_base = (CTYPE *) 0;
  317. jint _remaining;
  318. CTYPE *params = (CTYPE *) 0;
  319. int _needed = 0;
  320. if (!params_ref) {
  321. _exception = 1;
  322. _exceptionType = "java/lang/IllegalArgumentException";
  323. _exceptionMessage = "params == null";
  324. goto exit;
  325. }
  326. if (offset < 0) {
  327. _exception = 1;
  328. _exceptionType = "java/lang/IllegalArgumentException";
  329. _exceptionMessage = "offset < 0";
  330. goto exit;
  331. }
  332. _remaining = _env->GetArrayLength(params_ref) - offset;
  333. _needed = getNeededCount(pname);
  334. // if we didn't find this pname, we just assume the user passed
  335. // an array of the right size -- this might happen with extensions
  336. // or if we forget an enum here.
  337. if (_remaining < _needed) {
  338. _exception = 1;
  339. _exceptionType = "java/lang/IllegalArgumentException";
  340. _exceptionMessage = "length - offset < needed";
  341. goto exit;
  342. }
  343. params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
  344. _env, params_ref, (jboolean *)0);
  345. params = params_base + offset;
  346. GET(
  347. (GLenum)pname,
  348. (CTYPE *)params
  349. );
  350. exit:
  351. if (params_base) {
  352. releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
  353. _env, params_ref, params_base, !_exception);
  354. }
  355. if (_exception) {
  356. jniThrowException(_env, _exceptionType, _exceptionMessage);
  357. }
  358. }
  359. template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
  360. typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
  361. static void
  362. getarray
  363. (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
  364. jint _exception = 0;
  365. const char * _exceptionType;
  366. const char * _exceptionMessage;
  367. JTYPEARRAY _array = (JTYPEARRAY) 0;
  368. jint _bufferOffset = (jint) 0;
  369. jint _remaining;
  370. CTYPE *params = (CTYPE *) 0;
  371. int _needed = 0;
  372. params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  373. _remaining /= sizeof(CTYPE); // convert from bytes to item count
  374. _needed = getNeededCount(pname);
  375. // if we didn't find this pname, we just assume the user passed
  376. // an array of the right size -- this might happen with extensions
  377. // or if we forget an enum here.
  378. if (_needed>0 && _remaining < _needed) {
  379. _exception = 1;
  380. _exceptionType = "java/lang/IllegalArgumentException";
  381. _exceptionMessage = "remaining() < needed";
  382. goto exit;
  383. }
  384. if (params == NULL) {
  385. char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
  386. _env, _array, (jboolean *) 0);
  387. params = (CTYPE *) (_paramsBase + _bufferOffset);
  388. }
  389. GET(
  390. (GLenum)pname,
  391. (CTYPE *)params
  392. );
  393. exit:
  394. if (_array) {
  395. releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
  396. _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
  397. }
  398. if (_exception) {
  399. jniThrowException(_env, _exceptionType, _exceptionMessage);
  400. }
  401. }
  402. // --------------------------------------------------------------------------
  403. /* void glReadBuffer ( GLenum mode ) */
  404. static void
  405. android_glReadBuffer__I
  406. (JNIEnv *_env, jobject _this, jint mode) {
  407. glReadBuffer(
  408. (GLenum)mode
  409. );
  410. }
  411. /* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) */
  412. static void
  413. android_glDrawRangeElements__IIIIILjava_nio_Buffer_2
  414. (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jobject indices_buf) {
  415. jarray _array = (jarray) 0;
  416. jint _bufferOffset = (jint) 0;
  417. jint _remaining;
  418. GLvoid *indices = (GLvoid *) 0;
  419. indices = (GLvoid *)getPointer(_env, indices_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  420. if (indices == NULL) {
  421. char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
  422. indices = (GLvoid *) (_indicesBase + _bufferOffset);
  423. }
  424. glDrawRangeElements(
  425. (GLenum)mode,
  426. (GLuint)start,
  427. (GLuint)end,
  428. (GLsizei)count,
  429. (GLenum)type,
  430. (GLvoid *)indices
  431. );
  432. if (_array) {
  433. releasePointer(_env, _array, indices, JNI_FALSE);
  434. }
  435. }
  436. /* void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) */
  437. static void
  438. android_glDrawRangeElements__IIIIII
  439. (JNIEnv *_env, jobject _this, jint mode, jint start, jint end, jint count, jint type, jint offset) {
  440. glDrawRangeElements(
  441. (GLenum)mode,
  442. (GLuint)start,
  443. (GLuint)end,
  444. (GLsizei)count,
  445. (GLenum)type,
  446. reinterpret_cast<GLvoid *>(offset)
  447. );
  448. }
  449. /* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) */
  450. static void
  451. android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2
  452. (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jobject pixels_buf) {
  453. jarray _array = (jarray) 0;
  454. jint _bufferOffset = (jint) 0;
  455. jint _remaining;
  456. GLvoid *pixels = (GLvoid *) 0;
  457. if (pixels_buf) {
  458. pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  459. }
  460. if (pixels_buf && pixels == NULL) {
  461. char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
  462. pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
  463. }
  464. glTexImage3D(
  465. (GLenum)target,
  466. (GLint)level,
  467. (GLint)internalformat,
  468. (GLsizei)width,
  469. (GLsizei)height,
  470. (GLsizei)depth,
  471. (GLint)border,
  472. (GLenum)format,
  473. (GLenum)type,
  474. (GLvoid *)pixels
  475. );
  476. if (_array) {
  477. releasePointer(_env, _array, pixels, JNI_FALSE);
  478. }
  479. }
  480. /* void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei offset ) */
  481. static void
  482. android_glTexImage3D__IIIIIIIIII
  483. (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint format, jint type, jint offset) {
  484. glTexImage3D(
  485. (GLenum)target,
  486. (GLint)level,
  487. (GLint)internalformat,
  488. (GLsizei)width,
  489. (GLsizei)height,
  490. (GLsizei)depth,
  491. (GLint)border,
  492. (GLenum)format,
  493. (GLenum)type,
  494. reinterpret_cast<GLvoid *>(offset)
  495. );
  496. }
  497. /* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels ) */
  498. static void
  499. android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
  500. (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jobject pixels_buf) {
  501. jarray _array = (jarray) 0;
  502. jint _bufferOffset = (jint) 0;
  503. jint _remaining;
  504. GLvoid *pixels = (GLvoid *) 0;
  505. pixels = (GLvoid *)getPointer(_env, pixels_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  506. if (pixels == NULL) {
  507. char * _pixelsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
  508. pixels = (GLvoid *) (_pixelsBase + _bufferOffset);
  509. }
  510. glTexSubImage3D(
  511. (GLenum)target,
  512. (GLint)level,
  513. (GLint)xoffset,
  514. (GLint)yoffset,
  515. (GLint)zoffset,
  516. (GLsizei)width,
  517. (GLsizei)height,
  518. (GLsizei)depth,
  519. (GLenum)format,
  520. (GLenum)type,
  521. (GLvoid *)pixels
  522. );
  523. if (_array) {
  524. releasePointer(_env, _array, pixels, JNI_FALSE);
  525. }
  526. }
  527. /* void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei offset ) */
  528. static void
  529. android_glTexSubImage3D__IIIIIIIIIII
  530. (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint type, jint offset) {
  531. glTexSubImage3D(
  532. (GLenum)target,
  533. (GLint)level,
  534. (GLint)xoffset,
  535. (GLint)yoffset,
  536. (GLint)zoffset,
  537. (GLsizei)width,
  538. (GLsizei)height,
  539. (GLsizei)depth,
  540. (GLenum)format,
  541. (GLenum)type,
  542. reinterpret_cast<GLvoid *>(offset)
  543. );
  544. }
  545. /* void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) */
  546. static void
  547. android_glCopyTexSubImage3D__IIIIIIIII
  548. (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint x, jint y, jint width, jint height) {
  549. glCopyTexSubImage3D(
  550. (GLenum)target,
  551. (GLint)level,
  552. (GLint)xoffset,
  553. (GLint)yoffset,
  554. (GLint)zoffset,
  555. (GLint)x,
  556. (GLint)y,
  557. (GLsizei)width,
  558. (GLsizei)height
  559. );
  560. }
  561. /* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) */
  562. static void
  563. android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2
  564. (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jobject data_buf) {
  565. jarray _array = (jarray) 0;
  566. jint _bufferOffset = (jint) 0;
  567. jint _remaining;
  568. GLvoid *data = (GLvoid *) 0;
  569. data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  570. if (data == NULL) {
  571. char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
  572. data = (GLvoid *) (_dataBase + _bufferOffset);
  573. }
  574. glCompressedTexImage3D(
  575. (GLenum)target,
  576. (GLint)level,
  577. (GLenum)internalformat,
  578. (GLsizei)width,
  579. (GLsizei)height,
  580. (GLsizei)depth,
  581. (GLint)border,
  582. (GLsizei)imageSize,
  583. (GLvoid *)data
  584. );
  585. if (_array) {
  586. releasePointer(_env, _array, data, JNI_FALSE);
  587. }
  588. }
  589. /* void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei offset ) */
  590. static void
  591. android_glCompressedTexImage3D__IIIIIIIII
  592. (JNIEnv *_env, jobject _this, jint target, jint level, jint internalformat, jint width, jint height, jint depth, jint border, jint imageSize, jint offset) {
  593. glCompressedTexImage3D(
  594. (GLenum)target,
  595. (GLint)level,
  596. (GLenum)internalformat,
  597. (GLsizei)width,
  598. (GLsizei)height,
  599. (GLsizei)depth,
  600. (GLint)border,
  601. (GLsizei)imageSize,
  602. reinterpret_cast<GLvoid *>(offset)
  603. );
  604. }
  605. /* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ) */
  606. static void
  607. android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2
  608. (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jobject data_buf) {
  609. jarray _array = (jarray) 0;
  610. jint _bufferOffset = (jint) 0;
  611. jint _remaining;
  612. GLvoid *data = (GLvoid *) 0;
  613. data = (GLvoid *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  614. if (data == NULL) {
  615. char * _dataBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
  616. data = (GLvoid *) (_dataBase + _bufferOffset);
  617. }
  618. glCompressedTexSubImage3D(
  619. (GLenum)target,
  620. (GLint)level,
  621. (GLint)xoffset,
  622. (GLint)yoffset,
  623. (GLint)zoffset,
  624. (GLsizei)width,
  625. (GLsizei)height,
  626. (GLsizei)depth,
  627. (GLenum)format,
  628. (GLsizei)imageSize,
  629. (GLvoid *)data
  630. );
  631. if (_array) {
  632. releasePointer(_env, _array, data, JNI_FALSE);
  633. }
  634. }
  635. /* void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei offset ) */
  636. static void
  637. android_glCompressedTexSubImage3D__IIIIIIIIIII
  638. (JNIEnv *_env, jobject _this, jint target, jint level, jint xoffset, jint yoffset, jint zoffset, jint width, jint height, jint depth, jint format, jint imageSize, jint offset) {
  639. glCompressedTexSubImage3D(
  640. (GLenum)target,
  641. (GLint)level,
  642. (GLint)xoffset,
  643. (GLint)yoffset,
  644. (GLint)zoffset,
  645. (GLsizei)width,
  646. (GLsizei)height,
  647. (GLsizei)depth,
  648. (GLenum)format,
  649. (GLsizei)imageSize,
  650. reinterpret_cast<GLvoid *>(offset)
  651. );
  652. }
  653. /* void glGenQueries ( GLsizei n, GLuint *ids ) */
  654. static void
  655. android_glGenQueries__I_3II
  656. (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
  657. jint _exception = 0;
  658. const char * _exceptionType = NULL;
  659. const char * _exceptionMessage = NULL;
  660. GLuint *ids_base = (GLuint *) 0;
  661. jint _remaining;
  662. GLuint *ids = (GLuint *) 0;
  663. if (!ids_ref) {
  664. _exception = 1;
  665. _exceptionType = "java/lang/IllegalArgumentException";
  666. _exceptionMessage = "ids == null";
  667. goto exit;
  668. }
  669. if (offset < 0) {
  670. _exception = 1;
  671. _exceptionType = "java/lang/IllegalArgumentException";
  672. _exceptionMessage = "offset < 0";
  673. goto exit;
  674. }
  675. _remaining = _env->GetArrayLength(ids_ref) - offset;
  676. ids_base = (GLuint *)
  677. _env->GetIntArrayElements(ids_ref, (jboolean *)0);
  678. ids = ids_base + offset;
  679. glGenQueries(
  680. (GLsizei)n,
  681. (GLuint *)ids
  682. );
  683. exit:
  684. if (ids_base) {
  685. _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
  686. _exception ? JNI_ABORT: 0);
  687. }
  688. if (_exception) {
  689. jniThrowException(_env, _exceptionType, _exceptionMessage);
  690. }
  691. }
  692. /* void glGenQueries ( GLsizei n, GLuint *ids ) */
  693. static void
  694. android_glGenQueries__ILjava_nio_IntBuffer_2
  695. (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
  696. jintArray _array = (jintArray) 0;
  697. jint _bufferOffset = (jint) 0;
  698. jint _remaining;
  699. GLuint *ids = (GLuint *) 0;
  700. ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  701. if (ids == NULL) {
  702. char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  703. ids = (GLuint *) (_idsBase + _bufferOffset);
  704. }
  705. glGenQueries(
  706. (GLsizei)n,
  707. (GLuint *)ids
  708. );
  709. if (_array) {
  710. _env->ReleaseIntArrayElements(_array, (jint*)ids, 0);
  711. }
  712. }
  713. /* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
  714. static void
  715. android_glDeleteQueries__I_3II
  716. (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
  717. jint _exception = 0;
  718. const char * _exceptionType = NULL;
  719. const char * _exceptionMessage = NULL;
  720. GLuint *ids_base = (GLuint *) 0;
  721. jint _remaining;
  722. GLuint *ids = (GLuint *) 0;
  723. if (!ids_ref) {
  724. _exception = 1;
  725. _exceptionType = "java/lang/IllegalArgumentException";
  726. _exceptionMessage = "ids == null";
  727. goto exit;
  728. }
  729. if (offset < 0) {
  730. _exception = 1;
  731. _exceptionType = "java/lang/IllegalArgumentException";
  732. _exceptionMessage = "offset < 0";
  733. goto exit;
  734. }
  735. _remaining = _env->GetArrayLength(ids_ref) - offset;
  736. ids_base = (GLuint *)
  737. _env->GetIntArrayElements(ids_ref, (jboolean *)0);
  738. ids = ids_base + offset;
  739. glDeleteQueries(
  740. (GLsizei)n,
  741. (GLuint *)ids
  742. );
  743. exit:
  744. if (ids_base) {
  745. _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
  746. JNI_ABORT);
  747. }
  748. if (_exception) {
  749. jniThrowException(_env, _exceptionType, _exceptionMessage);
  750. }
  751. }
  752. /* void glDeleteQueries ( GLsizei n, const GLuint *ids ) */
  753. static void
  754. android_glDeleteQueries__ILjava_nio_IntBuffer_2
  755. (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
  756. jintArray _array = (jintArray) 0;
  757. jint _bufferOffset = (jint) 0;
  758. jint _remaining;
  759. GLuint *ids = (GLuint *) 0;
  760. ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  761. if (ids == NULL) {
  762. char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  763. ids = (GLuint *) (_idsBase + _bufferOffset);
  764. }
  765. glDeleteQueries(
  766. (GLsizei)n,
  767. (GLuint *)ids
  768. );
  769. if (_array) {
  770. _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
  771. }
  772. }
  773. /* GLboolean glIsQuery ( GLuint id ) */
  774. static jboolean
  775. android_glIsQuery__I
  776. (JNIEnv *_env, jobject _this, jint id) {
  777. GLboolean _returnValue;
  778. _returnValue = glIsQuery(
  779. (GLuint)id
  780. );
  781. return (jboolean)_returnValue;
  782. }
  783. /* void glBeginQuery ( GLenum target, GLuint id ) */
  784. static void
  785. android_glBeginQuery__II
  786. (JNIEnv *_env, jobject _this, jint target, jint id) {
  787. glBeginQuery(
  788. (GLenum)target,
  789. (GLuint)id
  790. );
  791. }
  792. /* void glEndQuery ( GLenum target ) */
  793. static void
  794. android_glEndQuery__I
  795. (JNIEnv *_env, jobject _this, jint target) {
  796. glEndQuery(
  797. (GLenum)target
  798. );
  799. }
  800. /* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
  801. static void
  802. android_glGetQueryiv__II_3II
  803. (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
  804. jint _exception = 0;
  805. const char * _exceptionType = NULL;
  806. const char * _exceptionMessage = NULL;
  807. GLint *params_base = (GLint *) 0;
  808. jint _remaining;
  809. GLint *params = (GLint *) 0;
  810. if (!params_ref) {
  811. _exception = 1;
  812. _exceptionType = "java/lang/IllegalArgumentException";
  813. _exceptionMessage = "params == null";
  814. goto exit;
  815. }
  816. if (offset < 0) {
  817. _exception = 1;
  818. _exceptionType = "java/lang/IllegalArgumentException";
  819. _exceptionMessage = "offset < 0";
  820. goto exit;
  821. }
  822. _remaining = _env->GetArrayLength(params_ref) - offset;
  823. params_base = (GLint *)
  824. _env->GetIntArrayElements(params_ref, (jboolean *)0);
  825. params = params_base + offset;
  826. glGetQueryiv(
  827. (GLenum)target,
  828. (GLenum)pname,
  829. (GLint *)params
  830. );
  831. exit:
  832. if (params_base) {
  833. _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
  834. _exception ? JNI_ABORT: 0);
  835. }
  836. if (_exception) {
  837. jniThrowException(_env, _exceptionType, _exceptionMessage);
  838. }
  839. }
  840. /* void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) */
  841. static void
  842. android_glGetQueryiv__IILjava_nio_IntBuffer_2
  843. (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
  844. jintArray _array = (jintArray) 0;
  845. jint _bufferOffset = (jint) 0;
  846. jint _remaining;
  847. GLint *params = (GLint *) 0;
  848. params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  849. if (params == NULL) {
  850. char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  851. params = (GLint *) (_paramsBase + _bufferOffset);
  852. }
  853. glGetQueryiv(
  854. (GLenum)target,
  855. (GLenum)pname,
  856. (GLint *)params
  857. );
  858. if (_array) {
  859. _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
  860. }
  861. }
  862. /* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
  863. static void
  864. android_glGetQueryObjectuiv__II_3II
  865. (JNIEnv *_env, jobject _this, jint id, jint pname, jintArray params_ref, jint offset) {
  866. jint _exception = 0;
  867. const char * _exceptionType = NULL;
  868. const char * _exceptionMessage = NULL;
  869. GLuint *params_base = (GLuint *) 0;
  870. jint _remaining;
  871. GLuint *params = (GLuint *) 0;
  872. if (!params_ref) {
  873. _exception = 1;
  874. _exceptionType = "java/lang/IllegalArgumentException";
  875. _exceptionMessage = "params == null";
  876. goto exit;
  877. }
  878. if (offset < 0) {
  879. _exception = 1;
  880. _exceptionType = "java/lang/IllegalArgumentException";
  881. _exceptionMessage = "offset < 0";
  882. goto exit;
  883. }
  884. _remaining = _env->GetArrayLength(params_ref) - offset;
  885. params_base = (GLuint *)
  886. _env->GetIntArrayElements(params_ref, (jboolean *)0);
  887. params = params_base + offset;
  888. glGetQueryObjectuiv(
  889. (GLuint)id,
  890. (GLenum)pname,
  891. (GLuint *)params
  892. );
  893. exit:
  894. if (params_base) {
  895. _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
  896. _exception ? JNI_ABORT: 0);
  897. }
  898. if (_exception) {
  899. jniThrowException(_env, _exceptionType, _exceptionMessage);
  900. }
  901. }
  902. /* void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) */
  903. static void
  904. android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2
  905. (JNIEnv *_env, jobject _this, jint id, jint pname, jobject params_buf) {
  906. jintArray _array = (jintArray) 0;
  907. jint _bufferOffset = (jint) 0;
  908. jint _remaining;
  909. GLuint *params = (GLuint *) 0;
  910. params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  911. if (params == NULL) {
  912. char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  913. params = (GLuint *) (_paramsBase + _bufferOffset);
  914. }
  915. glGetQueryObjectuiv(
  916. (GLuint)id,
  917. (GLenum)pname,
  918. (GLuint *)params
  919. );
  920. if (_array) {
  921. _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
  922. }
  923. }
  924. /* GLboolean glUnmapBuffer ( GLenum target ) */
  925. static jboolean
  926. android_glUnmapBuffer__I
  927. (JNIEnv *_env, jobject _this, jint target) {
  928. GLboolean _returnValue;
  929. _returnValue = glUnmapBuffer(
  930. (GLenum)target
  931. );
  932. return (jboolean)_returnValue;
  933. }
  934. /* void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) */
  935. static jobject
  936. android_glGetBufferPointerv__II
  937. (JNIEnv *_env, jobject _this, jint target, jint pname) {
  938. GLint64 _mapLength;
  939. GLvoid* _p;
  940. glGetBufferParameteri64v((GLenum)target, GL_BUFFER_MAP_LENGTH, &_mapLength);
  941. glGetBufferPointerv((GLenum)target, (GLenum)pname, &_p);
  942. return _env->NewDirectByteBuffer(_p, _mapLength);
  943. }
  944. /* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
  945. static void
  946. android_glDrawBuffers__I_3II
  947. (JNIEnv *_env, jobject _this, jint n, jintArray bufs_ref, jint offset) {
  948. jint _exception = 0;
  949. const char * _exceptionType = NULL;
  950. const char * _exceptionMessage = NULL;
  951. GLenum *bufs_base = (GLenum *) 0;
  952. jint _remaining;
  953. GLenum *bufs = (GLenum *) 0;
  954. if (!bufs_ref) {
  955. _exception = 1;
  956. _exceptionType = "java/lang/IllegalArgumentException";
  957. _exceptionMessage = "bufs == null";
  958. goto exit;
  959. }
  960. if (offset < 0) {
  961. _exception = 1;
  962. _exceptionType = "java/lang/IllegalArgumentException";
  963. _exceptionMessage = "offset < 0";
  964. goto exit;
  965. }
  966. _remaining = _env->GetArrayLength(bufs_ref) - offset;
  967. bufs_base = (GLenum *)
  968. _env->GetIntArrayElements(bufs_ref, (jboolean *)0);
  969. bufs = bufs_base + offset;
  970. glDrawBuffers(
  971. (GLsizei)n,
  972. (GLenum *)bufs
  973. );
  974. exit:
  975. if (bufs_base) {
  976. _env->ReleaseIntArrayElements(bufs_ref, (jint*)bufs_base,
  977. JNI_ABORT);
  978. }
  979. if (_exception) {
  980. jniThrowException(_env, _exceptionType, _exceptionMessage);
  981. }
  982. }
  983. /* void glDrawBuffers ( GLsizei n, const GLenum *bufs ) */
  984. static void
  985. android_glDrawBuffers__ILjava_nio_IntBuffer_2
  986. (JNIEnv *_env, jobject _this, jint n, jobject bufs_buf) {
  987. jintArray _array = (jintArray) 0;
  988. jint _bufferOffset = (jint) 0;
  989. jint _remaining;
  990. GLenum *bufs = (GLenum *) 0;
  991. bufs = (GLenum *)getPointer(_env, bufs_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  992. if (bufs == NULL) {
  993. char * _bufsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  994. bufs = (GLenum *) (_bufsBase + _bufferOffset);
  995. }
  996. glDrawBuffers(
  997. (GLsizei)n,
  998. (GLenum *)bufs
  999. );
  1000. if (_array) {
  1001. _env->ReleaseIntArrayElements(_array, (jint*)bufs, JNI_ABORT);
  1002. }
  1003. }
  1004. /* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1005. static void
  1006. android_glUniformMatrix2x3fv__IIZ_3FI
  1007. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
  1008. jint _exception = 0;
  1009. const char * _exceptionType = NULL;
  1010. const char * _exceptionMessage = NULL;
  1011. GLfloat *value_base = (GLfloat *) 0;
  1012. jint _remaining;
  1013. GLfloat *value = (GLfloat *) 0;
  1014. if (!value_ref) {
  1015. _exception = 1;
  1016. _exceptionType = "java/lang/IllegalArgumentException";
  1017. _exceptionMessage = "value == null";
  1018. goto exit;
  1019. }
  1020. if (offset < 0) {
  1021. _exception = 1;
  1022. _exceptionType = "java/lang/IllegalArgumentException";
  1023. _exceptionMessage = "offset < 0";
  1024. goto exit;
  1025. }
  1026. _remaining = _env->GetArrayLength(value_ref) - offset;
  1027. value_base = (GLfloat *)
  1028. _env->GetFloatArrayElements(value_ref, (jboolean *)0);
  1029. value = value_base + offset;
  1030. glUniformMatrix2x3fv(
  1031. (GLint)location,
  1032. (GLsizei)count,
  1033. (GLboolean)transpose,
  1034. (GLfloat *)value
  1035. );
  1036. exit:
  1037. if (value_base) {
  1038. _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
  1039. JNI_ABORT);
  1040. }
  1041. if (_exception) {
  1042. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1043. }
  1044. }
  1045. /* void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1046. static void
  1047. android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2
  1048. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
  1049. jfloatArray _array = (jfloatArray) 0;
  1050. jint _bufferOffset = (jint) 0;
  1051. jint _remaining;
  1052. GLfloat *value = (GLfloat *) 0;
  1053. value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  1054. if (value == NULL) {
  1055. char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
  1056. value = (GLfloat *) (_valueBase + _bufferOffset);
  1057. }
  1058. glUniformMatrix2x3fv(
  1059. (GLint)location,
  1060. (GLsizei)count,
  1061. (GLboolean)transpose,
  1062. (GLfloat *)value
  1063. );
  1064. if (_array) {
  1065. _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
  1066. }
  1067. }
  1068. /* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1069. static void
  1070. android_glUniformMatrix3x2fv__IIZ_3FI
  1071. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
  1072. jint _exception = 0;
  1073. const char * _exceptionType = NULL;
  1074. const char * _exceptionMessage = NULL;
  1075. GLfloat *value_base = (GLfloat *) 0;
  1076. jint _remaining;
  1077. GLfloat *value = (GLfloat *) 0;
  1078. if (!value_ref) {
  1079. _exception = 1;
  1080. _exceptionType = "java/lang/IllegalArgumentException";
  1081. _exceptionMessage = "value == null";
  1082. goto exit;
  1083. }
  1084. if (offset < 0) {
  1085. _exception = 1;
  1086. _exceptionType = "java/lang/IllegalArgumentException";
  1087. _exceptionMessage = "offset < 0";
  1088. goto exit;
  1089. }
  1090. _remaining = _env->GetArrayLength(value_ref) - offset;
  1091. value_base = (GLfloat *)
  1092. _env->GetFloatArrayElements(value_ref, (jboolean *)0);
  1093. value = value_base + offset;
  1094. glUniformMatrix3x2fv(
  1095. (GLint)location,
  1096. (GLsizei)count,
  1097. (GLboolean)transpose,
  1098. (GLfloat *)value
  1099. );
  1100. exit:
  1101. if (value_base) {
  1102. _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
  1103. JNI_ABORT);
  1104. }
  1105. if (_exception) {
  1106. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1107. }
  1108. }
  1109. /* void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1110. static void
  1111. android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2
  1112. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
  1113. jfloatArray _array = (jfloatArray) 0;
  1114. jint _bufferOffset = (jint) 0;
  1115. jint _remaining;
  1116. GLfloat *value = (GLfloat *) 0;
  1117. value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  1118. if (value == NULL) {
  1119. char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
  1120. value = (GLfloat *) (_valueBase + _bufferOffset);
  1121. }
  1122. glUniformMatrix3x2fv(
  1123. (GLint)location,
  1124. (GLsizei)count,
  1125. (GLboolean)transpose,
  1126. (GLfloat *)value
  1127. );
  1128. if (_array) {
  1129. _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
  1130. }
  1131. }
  1132. /* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1133. static void
  1134. android_glUniformMatrix2x4fv__IIZ_3FI
  1135. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
  1136. jint _exception = 0;
  1137. const char * _exceptionType = NULL;
  1138. const char * _exceptionMessage = NULL;
  1139. GLfloat *value_base = (GLfloat *) 0;
  1140. jint _remaining;
  1141. GLfloat *value = (GLfloat *) 0;
  1142. if (!value_ref) {
  1143. _exception = 1;
  1144. _exceptionType = "java/lang/IllegalArgumentException";
  1145. _exceptionMessage = "value == null";
  1146. goto exit;
  1147. }
  1148. if (offset < 0) {
  1149. _exception = 1;
  1150. _exceptionType = "java/lang/IllegalArgumentException";
  1151. _exceptionMessage = "offset < 0";
  1152. goto exit;
  1153. }
  1154. _remaining = _env->GetArrayLength(value_ref) - offset;
  1155. value_base = (GLfloat *)
  1156. _env->GetFloatArrayElements(value_ref, (jboolean *)0);
  1157. value = value_base + offset;
  1158. glUniformMatrix2x4fv(
  1159. (GLint)location,
  1160. (GLsizei)count,
  1161. (GLboolean)transpose,
  1162. (GLfloat *)value
  1163. );
  1164. exit:
  1165. if (value_base) {
  1166. _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
  1167. JNI_ABORT);
  1168. }
  1169. if (_exception) {
  1170. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1171. }
  1172. }
  1173. /* void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1174. static void
  1175. android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2
  1176. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
  1177. jfloatArray _array = (jfloatArray) 0;
  1178. jint _bufferOffset = (jint) 0;
  1179. jint _remaining;
  1180. GLfloat *value = (GLfloat *) 0;
  1181. value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  1182. if (value == NULL) {
  1183. char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
  1184. value = (GLfloat *) (_valueBase + _bufferOffset);
  1185. }
  1186. glUniformMatrix2x4fv(
  1187. (GLint)location,
  1188. (GLsizei)count,
  1189. (GLboolean)transpose,
  1190. (GLfloat *)value
  1191. );
  1192. if (_array) {
  1193. _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
  1194. }
  1195. }
  1196. /* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1197. static void
  1198. android_glUniformMatrix4x2fv__IIZ_3FI
  1199. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
  1200. jint _exception = 0;
  1201. const char * _exceptionType = NULL;
  1202. const char * _exceptionMessage = NULL;
  1203. GLfloat *value_base = (GLfloat *) 0;
  1204. jint _remaining;
  1205. GLfloat *value = (GLfloat *) 0;
  1206. if (!value_ref) {
  1207. _exception = 1;
  1208. _exceptionType = "java/lang/IllegalArgumentException";
  1209. _exceptionMessage = "value == null";
  1210. goto exit;
  1211. }
  1212. if (offset < 0) {
  1213. _exception = 1;
  1214. _exceptionType = "java/lang/IllegalArgumentException";
  1215. _exceptionMessage = "offset < 0";
  1216. goto exit;
  1217. }
  1218. _remaining = _env->GetArrayLength(value_ref) - offset;
  1219. value_base = (GLfloat *)
  1220. _env->GetFloatArrayElements(value_ref, (jboolean *)0);
  1221. value = value_base + offset;
  1222. glUniformMatrix4x2fv(
  1223. (GLint)location,
  1224. (GLsizei)count,
  1225. (GLboolean)transpose,
  1226. (GLfloat *)value
  1227. );
  1228. exit:
  1229. if (value_base) {
  1230. _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
  1231. JNI_ABORT);
  1232. }
  1233. if (_exception) {
  1234. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1235. }
  1236. }
  1237. /* void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1238. static void
  1239. android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2
  1240. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
  1241. jfloatArray _array = (jfloatArray) 0;
  1242. jint _bufferOffset = (jint) 0;
  1243. jint _remaining;
  1244. GLfloat *value = (GLfloat *) 0;
  1245. value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  1246. if (value == NULL) {
  1247. char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
  1248. value = (GLfloat *) (_valueBase + _bufferOffset);
  1249. }
  1250. glUniformMatrix4x2fv(
  1251. (GLint)location,
  1252. (GLsizei)count,
  1253. (GLboolean)transpose,
  1254. (GLfloat *)value
  1255. );
  1256. if (_array) {
  1257. _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
  1258. }
  1259. }
  1260. /* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1261. static void
  1262. android_glUniformMatrix3x4fv__IIZ_3FI
  1263. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
  1264. jint _exception = 0;
  1265. const char * _exceptionType = NULL;
  1266. const char * _exceptionMessage = NULL;
  1267. GLfloat *value_base = (GLfloat *) 0;
  1268. jint _remaining;
  1269. GLfloat *value = (GLfloat *) 0;
  1270. if (!value_ref) {
  1271. _exception = 1;
  1272. _exceptionType = "java/lang/IllegalArgumentException";
  1273. _exceptionMessage = "value == null";
  1274. goto exit;
  1275. }
  1276. if (offset < 0) {
  1277. _exception = 1;
  1278. _exceptionType = "java/lang/IllegalArgumentException";
  1279. _exceptionMessage = "offset < 0";
  1280. goto exit;
  1281. }
  1282. _remaining = _env->GetArrayLength(value_ref) - offset;
  1283. value_base = (GLfloat *)
  1284. _env->GetFloatArrayElements(value_ref, (jboolean *)0);
  1285. value = value_base + offset;
  1286. glUniformMatrix3x4fv(
  1287. (GLint)location,
  1288. (GLsizei)count,
  1289. (GLboolean)transpose,
  1290. (GLfloat *)value
  1291. );
  1292. exit:
  1293. if (value_base) {
  1294. _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
  1295. JNI_ABORT);
  1296. }
  1297. if (_exception) {
  1298. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1299. }
  1300. }
  1301. /* void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1302. static void
  1303. android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2
  1304. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
  1305. jfloatArray _array = (jfloatArray) 0;
  1306. jint _bufferOffset = (jint) 0;
  1307. jint _remaining;
  1308. GLfloat *value = (GLfloat *) 0;
  1309. value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  1310. if (value == NULL) {
  1311. char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
  1312. value = (GLfloat *) (_valueBase + _bufferOffset);
  1313. }
  1314. glUniformMatrix3x4fv(
  1315. (GLint)location,
  1316. (GLsizei)count,
  1317. (GLboolean)transpose,
  1318. (GLfloat *)value
  1319. );
  1320. if (_array) {
  1321. _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
  1322. }
  1323. }
  1324. /* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1325. static void
  1326. android_glUniformMatrix4x3fv__IIZ_3FI
  1327. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
  1328. jint _exception = 0;
  1329. const char * _exceptionType = NULL;
  1330. const char * _exceptionMessage = NULL;
  1331. GLfloat *value_base = (GLfloat *) 0;
  1332. jint _remaining;
  1333. GLfloat *value = (GLfloat *) 0;
  1334. if (!value_ref) {
  1335. _exception = 1;
  1336. _exceptionType = "java/lang/IllegalArgumentException";
  1337. _exceptionMessage = "value == null";
  1338. goto exit;
  1339. }
  1340. if (offset < 0) {
  1341. _exception = 1;
  1342. _exceptionType = "java/lang/IllegalArgumentException";
  1343. _exceptionMessage = "offset < 0";
  1344. goto exit;
  1345. }
  1346. _remaining = _env->GetArrayLength(value_ref) - offset;
  1347. value_base = (GLfloat *)
  1348. _env->GetFloatArrayElements(value_ref, (jboolean *)0);
  1349. value = value_base + offset;
  1350. glUniformMatrix4x3fv(
  1351. (GLint)location,
  1352. (GLsizei)count,
  1353. (GLboolean)transpose,
  1354. (GLfloat *)value
  1355. );
  1356. exit:
  1357. if (value_base) {
  1358. _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
  1359. JNI_ABORT);
  1360. }
  1361. if (_exception) {
  1362. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1363. }
  1364. }
  1365. /* void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
  1366. static void
  1367. android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2
  1368. (JNIEnv *_env, jobject _this, jint location, jint count, jboolean transpose, jobject value_buf) {
  1369. jfloatArray _array = (jfloatArray) 0;
  1370. jint _bufferOffset = (jint) 0;
  1371. jint _remaining;
  1372. GLfloat *value = (GLfloat *) 0;
  1373. value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  1374. if (value == NULL) {
  1375. char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
  1376. value = (GLfloat *) (_valueBase + _bufferOffset);
  1377. }
  1378. glUniformMatrix4x3fv(
  1379. (GLint)location,
  1380. (GLsizei)count,
  1381. (GLboolean)transpose,
  1382. (GLfloat *)value
  1383. );
  1384. if (_array) {
  1385. _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
  1386. }
  1387. }
  1388. /* void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) */
  1389. static void
  1390. android_glBlitFramebuffer__IIIIIIIIII
  1391. (JNIEnv *_env, jobject _this, jint srcX0, jint srcY0, jint srcX1, jint srcY1, jint dstX0, jint dstY0, jint dstX1, jint dstY1, jint mask, jint filter) {
  1392. glBlitFramebuffer(
  1393. (GLint)srcX0,
  1394. (GLint)srcY0,
  1395. (GLint)srcX1,
  1396. (GLint)srcY1,
  1397. (GLint)dstX0,
  1398. (GLint)dstY0,
  1399. (GLint)dstX1,
  1400. (GLint)dstY1,
  1401. (GLbitfield)mask,
  1402. (GLenum)filter
  1403. );
  1404. }
  1405. /* void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) */
  1406. static void
  1407. android_glRenderbufferStorageMultisample__IIIII
  1408. (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height) {
  1409. glRenderbufferStorageMultisample(
  1410. (GLenum)target,
  1411. (GLsizei)samples,
  1412. (GLenum)internalformat,
  1413. (GLsizei)width,
  1414. (GLsizei)height
  1415. );
  1416. }
  1417. /* void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) */
  1418. static void
  1419. android_glFramebufferTextureLayer__IIIII
  1420. (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level, jint layer) {
  1421. glFramebufferTextureLayer(
  1422. (GLenum)target,
  1423. (GLenum)attachment,
  1424. (GLuint)texture,
  1425. (GLint)level,
  1426. (GLint)layer
  1427. );
  1428. }
  1429. /* GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) */
  1430. static jobject
  1431. android_glMapBufferRange__IIII
  1432. (JNIEnv *_env, jobject _this, jint target, jint offset, jint length, jint access) {
  1433. GLvoid* _p = glMapBufferRange((GLenum)target,
  1434. (GLintptr)offset, (GLsizeiptr)length, (GLbitfield)access);
  1435. jobject _buf = (jobject)0;
  1436. if (_p) {
  1437. _buf = _env->NewDirectByteBuffer(_p, length);
  1438. }
  1439. return _buf;
  1440. }
  1441. /* void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length ) */
  1442. static void
  1443. android_glFlushMappedBufferRange__III
  1444. (JNIEnv *_env, jobject _this, jint target, jint offset, jint length) {
  1445. glFlushMappedBufferRange(
  1446. (GLenum)target,
  1447. (GLintptr)offset,
  1448. (GLsizeiptr)length
  1449. );
  1450. }
  1451. /* void glBindVertexArray ( GLuint array ) */
  1452. static void
  1453. android_glBindVertexArray__I
  1454. (JNIEnv *_env, jobject _this, jint array) {
  1455. glBindVertexArray(
  1456. (GLuint)array
  1457. );
  1458. }
  1459. /* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
  1460. static void
  1461. android_glDeleteVertexArrays__I_3II
  1462. (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
  1463. jint _exception = 0;
  1464. const char * _exceptionType = NULL;
  1465. const char * _exceptionMessage = NULL;
  1466. GLuint *arrays_base = (GLuint *) 0;
  1467. jint _remaining;
  1468. GLuint *arrays = (GLuint *) 0;
  1469. if (!arrays_ref) {
  1470. _exception = 1;
  1471. _exceptionType = "java/lang/IllegalArgumentException";
  1472. _exceptionMessage = "arrays == null";
  1473. goto exit;
  1474. }
  1475. if (offset < 0) {
  1476. _exception = 1;
  1477. _exceptionType = "java/lang/IllegalArgumentException";
  1478. _exceptionMessage = "offset < 0";
  1479. goto exit;
  1480. }
  1481. _remaining = _env->GetArrayLength(arrays_ref) - offset;
  1482. arrays_base = (GLuint *)
  1483. _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
  1484. arrays = arrays_base + offset;
  1485. glDeleteVertexArrays(
  1486. (GLsizei)n,
  1487. (GLuint *)arrays
  1488. );
  1489. exit:
  1490. if (arrays_base) {
  1491. _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
  1492. JNI_ABORT);
  1493. }
  1494. if (_exception) {
  1495. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1496. }
  1497. }
  1498. /* void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) */
  1499. static void
  1500. android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2
  1501. (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
  1502. jintArray _array = (jintArray) 0;
  1503. jint _bufferOffset = (jint) 0;
  1504. jint _remaining;
  1505. GLuint *arrays = (GLuint *) 0;
  1506. arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  1507. if (arrays == NULL) {
  1508. char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  1509. arrays = (GLuint *) (_arraysBase + _bufferOffset);
  1510. }
  1511. glDeleteVertexArrays(
  1512. (GLsizei)n,
  1513. (GLuint *)arrays
  1514. );
  1515. if (_array) {
  1516. _env->ReleaseIntArrayElements(_array, (jint*)arrays, JNI_ABORT);
  1517. }
  1518. }
  1519. /* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
  1520. static void
  1521. android_glGenVertexArrays__I_3II
  1522. (JNIEnv *_env, jobject _this, jint n, jintArray arrays_ref, jint offset) {
  1523. jint _exception = 0;
  1524. const char * _exceptionType = NULL;
  1525. const char * _exceptionMessage = NULL;
  1526. GLuint *arrays_base = (GLuint *) 0;
  1527. jint _remaining;
  1528. GLuint *arrays = (GLuint *) 0;
  1529. if (!arrays_ref) {
  1530. _exception = 1;
  1531. _exceptionType = "java/lang/IllegalArgumentException";
  1532. _exceptionMessage = "arrays == null";
  1533. goto exit;
  1534. }
  1535. if (offset < 0) {
  1536. _exception = 1;
  1537. _exceptionType = "java/lang/IllegalArgumentException";
  1538. _exceptionMessage = "offset < 0";
  1539. goto exit;
  1540. }
  1541. _remaining = _env->GetArrayLength(arrays_ref) - offset;
  1542. arrays_base = (GLuint *)
  1543. _env->GetIntArrayElements(arrays_ref, (jboolean *)0);
  1544. arrays = arrays_base + offset;
  1545. glGenVertexArrays(
  1546. (GLsizei)n,
  1547. (GLuint *)arrays
  1548. );
  1549. exit:
  1550. if (arrays_base) {
  1551. _env->ReleaseIntArrayElements(arrays_ref, (jint*)arrays_base,
  1552. _exception ? JNI_ABORT: 0);
  1553. }
  1554. if (_exception) {
  1555. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1556. }
  1557. }
  1558. /* void glGenVertexArrays ( GLsizei n, GLuint *arrays ) */
  1559. static void
  1560. android_glGenVertexArrays__ILjava_nio_IntBuffer_2
  1561. (JNIEnv *_env, jobject _this, jint n, jobject arrays_buf) {
  1562. jintArray _array = (jintArray) 0;
  1563. jint _bufferOffset = (jint) 0;
  1564. jint _remaining;
  1565. GLuint *arrays = (GLuint *) 0;
  1566. arrays = (GLuint *)getPointer(_env, arrays_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  1567. if (arrays == NULL) {
  1568. char * _arraysBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  1569. arrays = (GLuint *) (_arraysBase + _bufferOffset);
  1570. }
  1571. glGenVertexArrays(
  1572. (GLsizei)n,
  1573. (GLuint *)arrays
  1574. );
  1575. if (_array) {
  1576. _env->ReleaseIntArrayElements(_array, (jint*)arrays, 0);
  1577. }
  1578. }
  1579. /* GLboolean glIsVertexArray ( GLuint array ) */
  1580. static jboolean
  1581. android_glIsVertexArray__I
  1582. (JNIEnv *_env, jobject _this, jint array) {
  1583. GLboolean _returnValue;
  1584. _returnValue = glIsVertexArray(
  1585. (GLuint)array
  1586. );
  1587. return (jboolean)_returnValue;
  1588. }
  1589. /* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
  1590. static void
  1591. android_glGetIntegeri_v__II_3II
  1592. (JNIEnv *_env, jobject _this, jint target, jint index, jintArray data_ref, jint offset) {
  1593. jint _exception = 0;
  1594. const char * _exceptionType = NULL;
  1595. const char * _exceptionMessage = NULL;
  1596. GLint *data_base = (GLint *) 0;
  1597. jint _remaining;
  1598. GLint *data = (GLint *) 0;
  1599. if (!data_ref) {
  1600. _exception = 1;
  1601. _exceptionType = "java/lang/IllegalArgumentException";
  1602. _exceptionMessage = "data == null";
  1603. goto exit;
  1604. }
  1605. if (offset < 0) {
  1606. _exception = 1;
  1607. _exceptionType = "java/lang/IllegalArgumentException";
  1608. _exceptionMessage = "offset < 0";
  1609. goto exit;
  1610. }
  1611. _remaining = _env->GetArrayLength(data_ref) - offset;
  1612. data_base = (GLint *)
  1613. _env->GetIntArrayElements(data_ref, (jboolean *)0);
  1614. data = data_base + offset;
  1615. glGetIntegeri_v(
  1616. (GLenum)target,
  1617. (GLuint)index,
  1618. (GLint *)data
  1619. );
  1620. exit:
  1621. if (data_base) {
  1622. _env->ReleaseIntArrayElements(data_ref, (jint*)data_base,
  1623. _exception ? JNI_ABORT: 0);
  1624. }
  1625. if (_exception) {
  1626. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1627. }
  1628. }
  1629. /* void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) */
  1630. static void
  1631. android_glGetIntegeri_v__IILjava_nio_IntBuffer_2
  1632. (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
  1633. jintArray _array = (jintArray) 0;
  1634. jint _bufferOffset = (jint) 0;
  1635. jint _remaining;
  1636. GLint *data = (GLint *) 0;
  1637. data = (GLint *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  1638. if (data == NULL) {
  1639. char * _dataBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  1640. data = (GLint *) (_dataBase + _bufferOffset);
  1641. }
  1642. glGetIntegeri_v(
  1643. (GLenum)target,
  1644. (GLuint)index,
  1645. (GLint *)data
  1646. );
  1647. if (_array) {
  1648. _env->ReleaseIntArrayElements(_array, (jint*)data, 0);
  1649. }
  1650. }
  1651. /* void glBeginTransformFeedback ( GLenum primitiveMode ) */
  1652. static void
  1653. android_glBeginTransformFeedback__I
  1654. (JNIEnv *_env, jobject _this, jint primitiveMode) {
  1655. glBeginTransformFeedback(
  1656. (GLenum)primitiveMode
  1657. );
  1658. }
  1659. /* void glEndTransformFeedback ( void ) */
  1660. static void
  1661. android_glEndTransformFeedback__
  1662. (JNIEnv *_env, jobject _this) {
  1663. glEndTransformFeedback();
  1664. }
  1665. /* void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
  1666. static void
  1667. android_glBindBufferRange__IIIII
  1668. (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer, jint offset, jint size) {
  1669. glBindBufferRange(
  1670. (GLenum)target,
  1671. (GLuint)index,
  1672. (GLuint)buffer,
  1673. (GLintptr)offset,
  1674. (GLsizeiptr)size
  1675. );
  1676. }
  1677. /* void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) */
  1678. static void
  1679. android_glBindBufferBase__III
  1680. (JNIEnv *_env, jobject _this, jint target, jint index, jint buffer) {
  1681. glBindBufferBase(
  1682. (GLenum)target,
  1683. (GLuint)index,
  1684. (GLuint)buffer
  1685. );
  1686. }
  1687. /* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */
  1688. static
  1689. void
  1690. android_glTransformFeedbackVaryings
  1691. (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) {
  1692. jint _exception = 0;
  1693. const char* _exceptionType = NULL;
  1694. const char* _exceptionMessage = NULL;
  1695. jint _count = 0, _i;
  1696. const char** _varyings = NULL;
  1697. const char* _varying = NULL;
  1698. if (!varyings_ref) {
  1699. _exception = 1;
  1700. _exceptionType = "java/lang/IllegalArgumentException";
  1701. _exceptionMessage = "varyings == null";
  1702. goto exit;
  1703. }
  1704. _count = _env->GetArrayLength(varyings_ref);
  1705. _varyings = (const char**)calloc(_count, sizeof(const char*));
  1706. for (_i = 0; _i < _count; _i++) {
  1707. jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
  1708. if (!_varying) {
  1709. _exception = 1;
  1710. _exceptionType = "java/lang/IllegalArgumentException";
  1711. _exceptionMessage = "null varyings element";
  1712. goto exit;
  1713. }
  1714. _varyings[_i] = _env->GetStringUTFChars(_varying, 0);
  1715. }
  1716. glTransformFeedbackVaryings(program, _count, _varyings, bufferMode);
  1717. exit:
  1718. for (_i = _count - 1; _i >= 0; _i--) {
  1719. if (_varyings[_i]) {
  1720. jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
  1721. if (_varying) {
  1722. _env->ReleaseStringUTFChars(_varying, _varyings[_i]);
  1723. }
  1724. }
  1725. }
  1726. free(_varyings);
  1727. if (_exception) {
  1728. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1729. }
  1730. }
  1731. /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
  1732. static void
  1733. android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI
  1734. (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) {
  1735. jint _exception = 0;
  1736. const char * _exceptionType;
  1737. const char * _exceptionMessage;
  1738. GLsizei *length_base = (GLsizei *) 0;
  1739. jint _lengthRemaining;
  1740. GLsizei *length = (GLsizei *) 0;
  1741. GLint *size_base = (GLint *) 0;
  1742. jint _sizeRemaining;
  1743. GLint *size = (GLint *) 0;
  1744. GLenum *type_base = (GLenum *) 0;
  1745. jint _typeRemaining;
  1746. GLenum *type = (GLenum *) 0;
  1747. char *name_base = (char *) 0;
  1748. jint _nameRemaining;
  1749. char *name = (char *) 0;
  1750. if (length_ref) {
  1751. if (lengthOffset < 0) {
  1752. _exception = 1;
  1753. _exceptionType = "java/lang/IllegalArgumentException";
  1754. _exceptionMessage = "lengthOffset < 0";
  1755. goto exit;
  1756. }
  1757. _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
  1758. length_base = (GLsizei *)
  1759. _env->GetIntArrayElements(length_ref, (jboolean *)0);
  1760. length = length_base + lengthOffset;
  1761. }
  1762. if (!size_ref) {
  1763. _exception = 1;
  1764. _exceptionType = "java/lang/IllegalArgumentException";
  1765. _exceptionMessage = "size == null";
  1766. goto exit;
  1767. }
  1768. if (sizeOffset < 0) {
  1769. _exception = 1;
  1770. _exceptionType = "java/lang/IllegalArgumentException";
  1771. _exceptionMessage = "sizeOffset < 0";
  1772. goto exit;
  1773. }
  1774. _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
  1775. size_base = (GLint *)
  1776. _env->GetIntArrayElements(size_ref, (jboolean *)0);
  1777. size = size_base + sizeOffset;
  1778. if (!type_ref) {
  1779. _exception = 1;
  1780. _exceptionType = "java/lang/IllegalArgumentException";
  1781. _exceptionMessage = "type == null";
  1782. goto exit;
  1783. }
  1784. if (typeOffset < 0) {
  1785. _exception = 1;
  1786. _exceptionType = "java/lang/IllegalArgumentException";
  1787. _exceptionMessage = "typeOffset < 0";
  1788. goto exit;
  1789. }
  1790. _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
  1791. type_base = (GLenum *)
  1792. _env->GetIntArrayElements(type_ref, (jboolean *)0);
  1793. type = type_base + typeOffset;
  1794. if (!name_ref) {
  1795. _exception = 1;
  1796. _exceptionType = "java/lang/IllegalArgumentException";
  1797. _exceptionMessage = "name == null";
  1798. goto exit;
  1799. }
  1800. if (nameOffset < 0) {
  1801. _exception = 1;
  1802. _exceptionType = "java/lang/IllegalArgumentException";
  1803. _exceptionMessage = "nameOffset < 0";
  1804. goto exit;
  1805. }
  1806. _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
  1807. name_base = (char *)
  1808. _env->GetByteArrayElements(name_ref, (jboolean *)0);
  1809. name = name_base + nameOffset;
  1810. glGetTransformFeedbackVarying(
  1811. (GLuint)program,
  1812. (GLuint)index,
  1813. (GLsizei)bufsize,
  1814. (GLsizei *)length,
  1815. (GLint *)size,
  1816. (GLenum *)type,
  1817. (char *)name
  1818. );
  1819. exit:
  1820. if (name_base) {
  1821. _env->ReleaseByteArrayElements(name_ref, (jbyte*)name_base,
  1822. _exception ? JNI_ABORT: 0);
  1823. }
  1824. if (type_base) {
  1825. _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
  1826. _exception ? JNI_ABORT: 0);
  1827. }
  1828. if (size_base) {
  1829. _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
  1830. _exception ? JNI_ABORT: 0);
  1831. }
  1832. if (length_base) {
  1833. _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
  1834. _exception ? JNI_ABORT: 0);
  1835. }
  1836. if (_exception) {
  1837. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1838. }
  1839. }
  1840. /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
  1841. static void
  1842. android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B
  1843. (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) {
  1844. jniThrowException(_env, "java/lang/UnsupportedOperationException", "deprecated");
  1845. }
  1846. /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
  1847. static void
  1848. android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2
  1849. (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jobject name_buf) {
  1850. jintArray _lengthArray = (jintArray) 0;
  1851. jint _lengthBufferOffset = (jint) 0;
  1852. jintArray _sizeArray = (jintArray) 0;
  1853. jint _sizeBufferOffset = (jint) 0;
  1854. jintArray _typeArray = (jintArray) 0;
  1855. jint _typeBufferOffset = (jint) 0;
  1856. jbyteArray _nameArray = (jbyteArray)0;
  1857. jint _nameBufferOffset = (jint)0;
  1858. jint _lengthRemaining;
  1859. GLsizei *length = (GLsizei *) 0;
  1860. jint _sizeRemaining;
  1861. GLint *size = (GLint *) 0;
  1862. jint _typeRemaining;
  1863. GLenum *type = (GLenum *) 0;
  1864. jint _nameRemaining;
  1865. GLchar* name = (GLchar*)0;
  1866. length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
  1867. size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
  1868. type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
  1869. name = (GLchar*)getPointer(_env, name_buf, (jarray*)&_nameArray, &_nameRemaining, &_nameBufferOffset);
  1870. if (length == NULL) {
  1871. char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
  1872. length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
  1873. }
  1874. if (size == NULL) {
  1875. char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
  1876. size = (GLint *) (_sizeBase + _sizeBufferOffset);
  1877. }
  1878. if (type == NULL) {
  1879. char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
  1880. type = (GLenum *) (_typeBase + _typeBufferOffset);
  1881. }
  1882. if (name == NULL) {
  1883. char* _nameBase = (char *)_env->GetByteArrayElements(_nameArray, (jboolean*)0);
  1884. name = (GLchar *) (_nameBase + _nameBufferOffset);
  1885. }
  1886. glGetTransformFeedbackVarying(
  1887. (GLuint)program,
  1888. (GLuint)index,
  1889. (GLsizei)bufsize,
  1890. (GLsizei *)length,
  1891. (GLint *)size,
  1892. (GLenum *)type,
  1893. (GLchar*)name
  1894. );
  1895. if (_typeArray) {
  1896. releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
  1897. }
  1898. if (_sizeArray) {
  1899. releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
  1900. }
  1901. if (_lengthArray) {
  1902. releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _lengthArray, (jint*)length, JNI_TRUE);
  1903. }
  1904. if (_nameArray) {
  1905. releaseArrayPointer<jbyteArray, jbyte*, ByteArrayReleaser>(_env, _nameArray, (jbyte*)name, JNI_TRUE);
  1906. }
  1907. }
  1908. /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
  1909. static jstring
  1910. android_glGetTransformFeedbackVarying1
  1911. (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) {
  1912. jint _exception = 0;
  1913. const char * _exceptionType;
  1914. const char * _exceptionMessage;
  1915. GLint *size_base = (GLint *) 0;
  1916. jint _sizeRemaining;
  1917. GLint *size = (GLint *) 0;
  1918. GLenum *type_base = (GLenum *) 0;
  1919. jint _typeRemaining;
  1920. GLenum *type = (GLenum *) 0;
  1921. jstring result = 0;
  1922. GLint len = 0;
  1923. glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
  1924. if (!len) {
  1925. return _env->NewStringUTF("");
  1926. }
  1927. char* buf = (char*) malloc(len);
  1928. if (buf == NULL) {
  1929. jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
  1930. return NULL;
  1931. }
  1932. if (!size_ref) {
  1933. _exception = 1;
  1934. _exceptionType = "java/lang/IllegalArgumentException";
  1935. _exceptionMessage = "size == null";
  1936. goto exit;
  1937. }
  1938. if (sizeOffset < 0) {
  1939. _exception = 1;
  1940. _exceptionType = "java/lang/IllegalArgumentException";
  1941. _exceptionMessage = "sizeOffset < 0";
  1942. goto exit;
  1943. }
  1944. _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset;
  1945. size_base = (GLint *)
  1946. _env->GetIntArrayElements(size_ref, (jboolean *)0);
  1947. size = size_base + sizeOffset;
  1948. if (!type_ref) {
  1949. _exception = 1;
  1950. _exceptionType = "java/lang/IllegalArgumentException";
  1951. _exceptionMessage = "type == null";
  1952. goto exit;
  1953. }
  1954. if (typeOffset < 0) {
  1955. _exception = 1;
  1956. _exceptionType = "java/lang/IllegalArgumentException";
  1957. _exceptionMessage = "typeOffset < 0";
  1958. goto exit;
  1959. }
  1960. _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset;
  1961. type_base = (GLenum *)
  1962. _env->GetIntArrayElements(type_ref, (jboolean *)0);
  1963. type = type_base + typeOffset;
  1964. glGetTransformFeedbackVarying(
  1965. (GLuint)program,
  1966. (GLuint)index,
  1967. (GLsizei)len,
  1968. NULL,
  1969. (GLint *)size,
  1970. (GLenum *)type,
  1971. (char *)buf
  1972. );
  1973. exit:
  1974. if (type_base) {
  1975. _env->ReleaseIntArrayElements(type_ref, (jint*)type_base,
  1976. _exception ? JNI_ABORT: 0);
  1977. }
  1978. if (size_base) {
  1979. _env->ReleaseIntArrayElements(size_ref, (jint*)size_base,
  1980. _exception ? JNI_ABORT: 0);
  1981. }
  1982. if (_exception != 1) {
  1983. result = _env->NewStringUTF(buf);
  1984. }
  1985. if (buf) {
  1986. free(buf);
  1987. }
  1988. if (_exception) {
  1989. jniThrowException(_env, _exceptionType, _exceptionMessage);
  1990. }
  1991. if (result == 0) {
  1992. result = _env->NewStringUTF("");
  1993. }
  1994. return result;
  1995. }
  1996. /* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */
  1997. static jstring
  1998. android_glGetTransformFeedbackVarying2
  1999. (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) {
  2000. jintArray _sizeArray = (jintArray) 0;
  2001. jint _sizeBufferOffset = (jint) 0;
  2002. jintArray _typeArray = (jintArray) 0;
  2003. jint _typeBufferOffset = (jint) 0;
  2004. jint _lengthRemaining;
  2005. GLsizei *length = (GLsizei *) 0;
  2006. jint _sizeRemaining;
  2007. GLint *size = (GLint *) 0;
  2008. jint _typeRemaining;
  2009. GLenum *type = (GLenum *) 0;
  2010. jstring result = 0;
  2011. GLint len = 0;
  2012. glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len);
  2013. if (!len) {
  2014. return _env->NewStringUTF("");
  2015. }
  2016. char* buf = (char*) malloc(len);
  2017. if (buf == NULL) {
  2018. jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory");
  2019. return NULL;
  2020. }
  2021. size = (GLint *)getPointer(_env, size_buf, (jarray*)&_sizeArray, &_sizeRemaining, &_sizeBufferOffset);
  2022. type = (GLenum *)getPointer(_env, type_buf, (jarray*)&_typeArray, &_typeRemaining, &_typeBufferOffset);
  2023. if (size == NULL) {
  2024. char * _sizeBase = (char *)_env->GetIntArrayElements(_sizeArray, (jboolean *) 0);
  2025. size = (GLint *) (_sizeBase + _sizeBufferOffset);
  2026. }
  2027. if (type == NULL) {
  2028. char * _typeBase = (char *)_env->GetIntArrayElements(_typeArray, (jboolean *) 0);
  2029. type = (GLenum *) (_typeBase + _typeBufferOffset);
  2030. }
  2031. glGetTransformFeedbackVarying(
  2032. (GLuint)program,
  2033. (GLuint)index,
  2034. (GLsizei)len,
  2035. NULL,
  2036. (GLint *)size,
  2037. (GLenum *)type,
  2038. (char *)buf
  2039. );
  2040. if (_typeArray) {
  2041. releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _typeArray, (jint*)type, JNI_TRUE);
  2042. }
  2043. if (_sizeArray) {
  2044. releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(_env, _sizeArray, (jint*)size, JNI_TRUE);
  2045. }
  2046. result = _env->NewStringUTF(buf);
  2047. if (buf) {
  2048. free(buf);
  2049. }
  2050. return result;
  2051. }
  2052. /* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) */
  2053. static void
  2054. android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I
  2055. (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jobject pointer_buf, jint remaining) {
  2056. jarray _array = (jarray) 0;
  2057. jint _bufferOffset = (jint) 0;
  2058. jint _remaining;
  2059. GLvoid *pointer = (GLvoid *) 0;
  2060. if (pointer_buf) {
  2061. pointer = (GLvoid *) getDirectBufferPointer(_env, pointer_buf);
  2062. if ( ! pointer ) {
  2063. return;
  2064. }
  2065. }
  2066. glVertexAttribIPointerBounds(
  2067. (GLuint)index,
  2068. (GLint)size,
  2069. (GLenum)type,
  2070. (GLsizei)stride,
  2071. (GLvoid *)pointer,
  2072. (GLsizei)remaining
  2073. );
  2074. }
  2075. /* void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) */
  2076. static void
  2077. android_glVertexAttribIPointer__IIIII
  2078. (JNIEnv *_env, jobject _this, jint index, jint size, jint type, jint stride, jint offset) {
  2079. glVertexAttribIPointer(
  2080. (GLuint)index,
  2081. (GLint)size,
  2082. (GLenum)type,
  2083. (GLsizei)stride,
  2084. reinterpret_cast<GLvoid *>(offset)
  2085. );
  2086. }
  2087. /* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
  2088. static void
  2089. android_glGetVertexAttribIiv__II_3II
  2090. (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
  2091. jint _exception = 0;
  2092. const char * _exceptionType = NULL;
  2093. const char * _exceptionMessage = NULL;
  2094. GLint *params_base = (GLint *) 0;
  2095. jint _remaining;
  2096. GLint *params = (GLint *) 0;
  2097. if (!params_ref) {
  2098. _exception = 1;
  2099. _exceptionType = "java/lang/IllegalArgumentException";
  2100. _exceptionMessage = "params == null";
  2101. goto exit;
  2102. }
  2103. if (offset < 0) {
  2104. _exception = 1;
  2105. _exceptionType = "java/lang/IllegalArgumentException";
  2106. _exceptionMessage = "offset < 0";
  2107. goto exit;
  2108. }
  2109. _remaining = _env->GetArrayLength(params_ref) - offset;
  2110. params_base = (GLint *)
  2111. _env->GetIntArrayElements(params_ref, (jboolean *)0);
  2112. params = params_base + offset;
  2113. glGetVertexAttribIiv(
  2114. (GLuint)index,
  2115. (GLenum)pname,
  2116. (GLint *)params
  2117. );
  2118. exit:
  2119. if (params_base) {
  2120. _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
  2121. _exception ? JNI_ABORT: 0);
  2122. }
  2123. if (_exception) {
  2124. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2125. }
  2126. }
  2127. /* void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) */
  2128. static void
  2129. android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2
  2130. (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
  2131. jintArray _array = (jintArray) 0;
  2132. jint _bufferOffset = (jint) 0;
  2133. jint _remaining;
  2134. GLint *params = (GLint *) 0;
  2135. params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2136. if (params == NULL) {
  2137. char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2138. params = (GLint *) (_paramsBase + _bufferOffset);
  2139. }
  2140. glGetVertexAttribIiv(
  2141. (GLuint)index,
  2142. (GLenum)pname,
  2143. (GLint *)params
  2144. );
  2145. if (_array) {
  2146. _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
  2147. }
  2148. }
  2149. /* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
  2150. static void
  2151. android_glGetVertexAttribIuiv__II_3II
  2152. (JNIEnv *_env, jobject _this, jint index, jint pname, jintArray params_ref, jint offset) {
  2153. jint _exception = 0;
  2154. const char * _exceptionType = NULL;
  2155. const char * _exceptionMessage = NULL;
  2156. GLuint *params_base = (GLuint *) 0;
  2157. jint _remaining;
  2158. GLuint *params = (GLuint *) 0;
  2159. if (!params_ref) {
  2160. _exception = 1;
  2161. _exceptionType = "java/lang/IllegalArgumentException";
  2162. _exceptionMessage = "params == null";
  2163. goto exit;
  2164. }
  2165. if (offset < 0) {
  2166. _exception = 1;
  2167. _exceptionType = "java/lang/IllegalArgumentException";
  2168. _exceptionMessage = "offset < 0";
  2169. goto exit;
  2170. }
  2171. _remaining = _env->GetArrayLength(params_ref) - offset;
  2172. params_base = (GLuint *)
  2173. _env->GetIntArrayElements(params_ref, (jboolean *)0);
  2174. params = params_base + offset;
  2175. glGetVertexAttribIuiv(
  2176. (GLuint)index,
  2177. (GLenum)pname,
  2178. (GLuint *)params
  2179. );
  2180. exit:
  2181. if (params_base) {
  2182. _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
  2183. _exception ? JNI_ABORT: 0);
  2184. }
  2185. if (_exception) {
  2186. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2187. }
  2188. }
  2189. /* void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) */
  2190. static void
  2191. android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2
  2192. (JNIEnv *_env, jobject _this, jint index, jint pname, jobject params_buf) {
  2193. jintArray _array = (jintArray) 0;
  2194. jint _bufferOffset = (jint) 0;
  2195. jint _remaining;
  2196. GLuint *params = (GLuint *) 0;
  2197. params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2198. if (params == NULL) {
  2199. char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2200. params = (GLuint *) (_paramsBase + _bufferOffset);
  2201. }
  2202. glGetVertexAttribIuiv(
  2203. (GLuint)index,
  2204. (GLenum)pname,
  2205. (GLuint *)params
  2206. );
  2207. if (_array) {
  2208. _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
  2209. }
  2210. }
  2211. /* void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) */
  2212. static void
  2213. android_glVertexAttribI4i__IIIII
  2214. (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
  2215. glVertexAttribI4i(
  2216. (GLuint)index,
  2217. (GLint)x,
  2218. (GLint)y,
  2219. (GLint)z,
  2220. (GLint)w
  2221. );
  2222. }
  2223. /* void glVertexAttribI4ui ( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) */
  2224. static void
  2225. android_glVertexAttribI4ui__IIIII
  2226. (JNIEnv *_env, jobject _this, jint index, jint x, jint y, jint z, jint w) {
  2227. glVertexAttribI4ui(
  2228. (GLuint)index,
  2229. (GLuint)x,
  2230. (GLuint)y,
  2231. (GLuint)z,
  2232. (GLuint)w
  2233. );
  2234. }
  2235. /* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
  2236. static void
  2237. android_glVertexAttribI4iv__I_3II
  2238. (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
  2239. jint _exception = 0;
  2240. const char * _exceptionType = NULL;
  2241. const char * _exceptionMessage = NULL;
  2242. GLint *v_base = (GLint *) 0;
  2243. jint _remaining;
  2244. GLint *v = (GLint *) 0;
  2245. if (!v_ref) {
  2246. _exception = 1;
  2247. _exceptionType = "java/lang/IllegalArgumentException";
  2248. _exceptionMessage = "v == null";
  2249. goto exit;
  2250. }
  2251. if (offset < 0) {
  2252. _exception = 1;
  2253. _exceptionType = "java/lang/IllegalArgumentException";
  2254. _exceptionMessage = "offset < 0";
  2255. goto exit;
  2256. }
  2257. _remaining = _env->GetArrayLength(v_ref) - offset;
  2258. v_base = (GLint *)
  2259. _env->GetIntArrayElements(v_ref, (jboolean *)0);
  2260. v = v_base + offset;
  2261. glVertexAttribI4iv(
  2262. (GLuint)index,
  2263. (GLint *)v
  2264. );
  2265. exit:
  2266. if (v_base) {
  2267. _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
  2268. JNI_ABORT);
  2269. }
  2270. if (_exception) {
  2271. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2272. }
  2273. }
  2274. /* void glVertexAttribI4iv ( GLuint index, const GLint *v ) */
  2275. static void
  2276. android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2
  2277. (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
  2278. jintArray _array = (jintArray) 0;
  2279. jint _bufferOffset = (jint) 0;
  2280. jint _remaining;
  2281. GLint *v = (GLint *) 0;
  2282. v = (GLint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2283. if (v == NULL) {
  2284. char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2285. v = (GLint *) (_vBase + _bufferOffset);
  2286. }
  2287. glVertexAttribI4iv(
  2288. (GLuint)index,
  2289. (GLint *)v
  2290. );
  2291. if (_array) {
  2292. _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
  2293. }
  2294. }
  2295. /* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
  2296. static void
  2297. android_glVertexAttribI4uiv__I_3II
  2298. (JNIEnv *_env, jobject _this, jint index, jintArray v_ref, jint offset) {
  2299. jint _exception = 0;
  2300. const char * _exceptionType = NULL;
  2301. const char * _exceptionMessage = NULL;
  2302. GLuint *v_base = (GLuint *) 0;
  2303. jint _remaining;
  2304. GLuint *v = (GLuint *) 0;
  2305. if (!v_ref) {
  2306. _exception = 1;
  2307. _exceptionType = "java/lang/IllegalArgumentException";
  2308. _exceptionMessage = "v == null";
  2309. goto exit;
  2310. }
  2311. if (offset < 0) {
  2312. _exception = 1;
  2313. _exceptionType = "java/lang/IllegalArgumentException";
  2314. _exceptionMessage = "offset < 0";
  2315. goto exit;
  2316. }
  2317. _remaining = _env->GetArrayLength(v_ref) - offset;
  2318. v_base = (GLuint *)
  2319. _env->GetIntArrayElements(v_ref, (jboolean *)0);
  2320. v = v_base + offset;
  2321. glVertexAttribI4uiv(
  2322. (GLuint)index,
  2323. (GLuint *)v
  2324. );
  2325. exit:
  2326. if (v_base) {
  2327. _env->ReleaseIntArrayElements(v_ref, (jint*)v_base,
  2328. JNI_ABORT);
  2329. }
  2330. if (_exception) {
  2331. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2332. }
  2333. }
  2334. /* void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) */
  2335. static void
  2336. android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2
  2337. (JNIEnv *_env, jobject _this, jint index, jobject v_buf) {
  2338. jintArray _array = (jintArray) 0;
  2339. jint _bufferOffset = (jint) 0;
  2340. jint _remaining;
  2341. GLuint *v = (GLuint *) 0;
  2342. v = (GLuint *)getPointer(_env, v_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2343. if (v == NULL) {
  2344. char * _vBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2345. v = (GLuint *) (_vBase + _bufferOffset);
  2346. }
  2347. glVertexAttribI4uiv(
  2348. (GLuint)index,
  2349. (GLuint *)v
  2350. );
  2351. if (_array) {
  2352. _env->ReleaseIntArrayElements(_array, (jint*)v, JNI_ABORT);
  2353. }
  2354. }
  2355. /* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
  2356. static void
  2357. android_glGetUniformuiv__II_3II
  2358. (JNIEnv *_env, jobject _this, jint program, jint location, jintArray params_ref, jint offset) {
  2359. jint _exception = 0;
  2360. const char * _exceptionType = NULL;
  2361. const char * _exceptionMessage = NULL;
  2362. GLuint *params_base = (GLuint *) 0;
  2363. jint _remaining;
  2364. GLuint *params = (GLuint *) 0;
  2365. if (!params_ref) {
  2366. _exception = 1;
  2367. _exceptionType = "java/lang/IllegalArgumentException";
  2368. _exceptionMessage = "params == null";
  2369. goto exit;
  2370. }
  2371. if (offset < 0) {
  2372. _exception = 1;
  2373. _exceptionType = "java/lang/IllegalArgumentException";
  2374. _exceptionMessage = "offset < 0";
  2375. goto exit;
  2376. }
  2377. _remaining = _env->GetArrayLength(params_ref) - offset;
  2378. params_base = (GLuint *)
  2379. _env->GetIntArrayElements(params_ref, (jboolean *)0);
  2380. params = params_base + offset;
  2381. glGetUniformuiv(
  2382. (GLuint)program,
  2383. (GLint)location,
  2384. (GLuint *)params
  2385. );
  2386. exit:
  2387. if (params_base) {
  2388. _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
  2389. _exception ? JNI_ABORT: 0);
  2390. }
  2391. if (_exception) {
  2392. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2393. }
  2394. }
  2395. /* void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) */
  2396. static void
  2397. android_glGetUniformuiv__IILjava_nio_IntBuffer_2
  2398. (JNIEnv *_env, jobject _this, jint program, jint location, jobject params_buf) {
  2399. jintArray _array = (jintArray) 0;
  2400. jint _bufferOffset = (jint) 0;
  2401. jint _remaining;
  2402. GLuint *params = (GLuint *) 0;
  2403. params = (GLuint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2404. if (params == NULL) {
  2405. char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2406. params = (GLuint *) (_paramsBase + _bufferOffset);
  2407. }
  2408. glGetUniformuiv(
  2409. (GLuint)program,
  2410. (GLint)location,
  2411. (GLuint *)params
  2412. );
  2413. if (_array) {
  2414. _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
  2415. }
  2416. }
  2417. /* GLint glGetFragDataLocation ( GLuint program, const GLchar *name ) */
  2418. static jint
  2419. android_glGetFragDataLocation__ILjava_lang_String_2
  2420. (JNIEnv *_env, jobject _this, jint program, jstring name) {
  2421. jint _exception = 0;
  2422. const char * _exceptionType = NULL;
  2423. const char * _exceptionMessage = NULL;
  2424. GLint _returnValue = 0;
  2425. const char* _nativename = 0;
  2426. if (!name) {
  2427. _exception = 1;
  2428. _exceptionType = "java/lang/IllegalArgumentException";
  2429. _exceptionMessage = "name == null";
  2430. goto exit;
  2431. }
  2432. _nativename = _env->GetStringUTFChars(name, 0);
  2433. _returnValue = glGetFragDataLocation(
  2434. (GLuint)program,
  2435. (GLchar *)_nativename
  2436. );
  2437. exit:
  2438. if (_nativename) {
  2439. _env->ReleaseStringUTFChars(name, _nativename);
  2440. }
  2441. if (_exception) {
  2442. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2443. }
  2444. return (jint)_returnValue;
  2445. }
  2446. /* void glUniform1ui ( GLint location, GLuint v0 ) */
  2447. static void
  2448. android_glUniform1ui__II
  2449. (JNIEnv *_env, jobject _this, jint location, jint v0) {
  2450. glUniform1ui(
  2451. (GLint)location,
  2452. (GLuint)v0
  2453. );
  2454. }
  2455. /* void glUniform2ui ( GLint location, GLuint v0, GLuint v1 ) */
  2456. static void
  2457. android_glUniform2ui__III
  2458. (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1) {
  2459. glUniform2ui(
  2460. (GLint)location,
  2461. (GLuint)v0,
  2462. (GLuint)v1
  2463. );
  2464. }
  2465. /* void glUniform3ui ( GLint location, GLuint v0, GLuint v1, GLuint v2 ) */
  2466. static void
  2467. android_glUniform3ui__IIII
  2468. (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2) {
  2469. glUniform3ui(
  2470. (GLint)location,
  2471. (GLuint)v0,
  2472. (GLuint)v1,
  2473. (GLuint)v2
  2474. );
  2475. }
  2476. /* void glUniform4ui ( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) */
  2477. static void
  2478. android_glUniform4ui__IIIII
  2479. (JNIEnv *_env, jobject _this, jint location, jint v0, jint v1, jint v2, jint v3) {
  2480. glUniform4ui(
  2481. (GLint)location,
  2482. (GLuint)v0,
  2483. (GLuint)v1,
  2484. (GLuint)v2,
  2485. (GLuint)v3
  2486. );
  2487. }
  2488. /* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
  2489. static void
  2490. android_glUniform1uiv__II_3II
  2491. (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
  2492. jint _exception = 0;
  2493. const char * _exceptionType = NULL;
  2494. const char * _exceptionMessage = NULL;
  2495. GLuint *value_base = (GLuint *) 0;
  2496. jint _remaining;
  2497. GLuint *value = (GLuint *) 0;
  2498. if (!value_ref) {
  2499. _exception = 1;
  2500. _exceptionType = "java/lang/IllegalArgumentException";
  2501. _exceptionMessage = "value == null";
  2502. goto exit;
  2503. }
  2504. if (offset < 0) {
  2505. _exception = 1;
  2506. _exceptionType = "java/lang/IllegalArgumentException";
  2507. _exceptionMessage = "offset < 0";
  2508. goto exit;
  2509. }
  2510. _remaining = _env->GetArrayLength(value_ref) - offset;
  2511. value_base = (GLuint *)
  2512. _env->GetIntArrayElements(value_ref, (jboolean *)0);
  2513. value = value_base + offset;
  2514. glUniform1uiv(
  2515. (GLint)location,
  2516. (GLsizei)count,
  2517. (GLuint *)value
  2518. );
  2519. exit:
  2520. if (value_base) {
  2521. _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
  2522. JNI_ABORT);
  2523. }
  2524. if (_exception) {
  2525. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2526. }
  2527. }
  2528. /* void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) */
  2529. static void
  2530. android_glUniform1uiv__IILjava_nio_IntBuffer_2
  2531. (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
  2532. jintArray _array = (jintArray) 0;
  2533. jint _bufferOffset = (jint) 0;
  2534. jint _remaining;
  2535. GLuint *value = (GLuint *) 0;
  2536. value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2537. if (value == NULL) {
  2538. char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2539. value = (GLuint *) (_valueBase + _bufferOffset);
  2540. }
  2541. glUniform1uiv(
  2542. (GLint)location,
  2543. (GLsizei)count,
  2544. (GLuint *)value
  2545. );
  2546. if (_array) {
  2547. _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
  2548. }
  2549. }
  2550. /* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
  2551. static void
  2552. android_glUniform2uiv__II_3II
  2553. (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
  2554. jint _exception = 0;
  2555. const char * _exceptionType = NULL;
  2556. const char * _exceptionMessage = NULL;
  2557. GLuint *value_base = (GLuint *) 0;
  2558. jint _remaining;
  2559. GLuint *value = (GLuint *) 0;
  2560. if (!value_ref) {
  2561. _exception = 1;
  2562. _exceptionType = "java/lang/IllegalArgumentException";
  2563. _exceptionMessage = "value == null";
  2564. goto exit;
  2565. }
  2566. if (offset < 0) {
  2567. _exception = 1;
  2568. _exceptionType = "java/lang/IllegalArgumentException";
  2569. _exceptionMessage = "offset < 0";
  2570. goto exit;
  2571. }
  2572. _remaining = _env->GetArrayLength(value_ref) - offset;
  2573. value_base = (GLuint *)
  2574. _env->GetIntArrayElements(value_ref, (jboolean *)0);
  2575. value = value_base + offset;
  2576. glUniform2uiv(
  2577. (GLint)location,
  2578. (GLsizei)count,
  2579. (GLuint *)value
  2580. );
  2581. exit:
  2582. if (value_base) {
  2583. _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
  2584. JNI_ABORT);
  2585. }
  2586. if (_exception) {
  2587. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2588. }
  2589. }
  2590. /* void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) */
  2591. static void
  2592. android_glUniform2uiv__IILjava_nio_IntBuffer_2
  2593. (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
  2594. jintArray _array = (jintArray) 0;
  2595. jint _bufferOffset = (jint) 0;
  2596. jint _remaining;
  2597. GLuint *value = (GLuint *) 0;
  2598. value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2599. if (value == NULL) {
  2600. char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2601. value = (GLuint *) (_valueBase + _bufferOffset);
  2602. }
  2603. glUniform2uiv(
  2604. (GLint)location,
  2605. (GLsizei)count,
  2606. (GLuint *)value
  2607. );
  2608. if (_array) {
  2609. _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
  2610. }
  2611. }
  2612. /* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
  2613. static void
  2614. android_glUniform3uiv__II_3II
  2615. (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
  2616. jint _exception = 0;
  2617. const char * _exceptionType = NULL;
  2618. const char * _exceptionMessage = NULL;
  2619. GLuint *value_base = (GLuint *) 0;
  2620. jint _remaining;
  2621. GLuint *value = (GLuint *) 0;
  2622. if (!value_ref) {
  2623. _exception = 1;
  2624. _exceptionType = "java/lang/IllegalArgumentException";
  2625. _exceptionMessage = "value == null";
  2626. goto exit;
  2627. }
  2628. if (offset < 0) {
  2629. _exception = 1;
  2630. _exceptionType = "java/lang/IllegalArgumentException";
  2631. _exceptionMessage = "offset < 0";
  2632. goto exit;
  2633. }
  2634. _remaining = _env->GetArrayLength(value_ref) - offset;
  2635. value_base = (GLuint *)
  2636. _env->GetIntArrayElements(value_ref, (jboolean *)0);
  2637. value = value_base + offset;
  2638. glUniform3uiv(
  2639. (GLint)location,
  2640. (GLsizei)count,
  2641. (GLuint *)value
  2642. );
  2643. exit:
  2644. if (value_base) {
  2645. _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
  2646. JNI_ABORT);
  2647. }
  2648. if (_exception) {
  2649. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2650. }
  2651. }
  2652. /* void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) */
  2653. static void
  2654. android_glUniform3uiv__IILjava_nio_IntBuffer_2
  2655. (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
  2656. jintArray _array = (jintArray) 0;
  2657. jint _bufferOffset = (jint) 0;
  2658. jint _remaining;
  2659. GLuint *value = (GLuint *) 0;
  2660. value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2661. if (value == NULL) {
  2662. char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2663. value = (GLuint *) (_valueBase + _bufferOffset);
  2664. }
  2665. glUniform3uiv(
  2666. (GLint)location,
  2667. (GLsizei)count,
  2668. (GLuint *)value
  2669. );
  2670. if (_array) {
  2671. _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
  2672. }
  2673. }
  2674. /* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
  2675. static void
  2676. android_glUniform4uiv__II_3II
  2677. (JNIEnv *_env, jobject _this, jint location, jint count, jintArray value_ref, jint offset) {
  2678. jint _exception = 0;
  2679. const char * _exceptionType = NULL;
  2680. const char * _exceptionMessage = NULL;
  2681. GLuint *value_base = (GLuint *) 0;
  2682. jint _remaining;
  2683. GLuint *value = (GLuint *) 0;
  2684. if (!value_ref) {
  2685. _exception = 1;
  2686. _exceptionType = "java/lang/IllegalArgumentException";
  2687. _exceptionMessage = "value == null";
  2688. goto exit;
  2689. }
  2690. if (offset < 0) {
  2691. _exception = 1;
  2692. _exceptionType = "java/lang/IllegalArgumentException";
  2693. _exceptionMessage = "offset < 0";
  2694. goto exit;
  2695. }
  2696. _remaining = _env->GetArrayLength(value_ref) - offset;
  2697. value_base = (GLuint *)
  2698. _env->GetIntArrayElements(value_ref, (jboolean *)0);
  2699. value = value_base + offset;
  2700. glUniform4uiv(
  2701. (GLint)location,
  2702. (GLsizei)count,
  2703. (GLuint *)value
  2704. );
  2705. exit:
  2706. if (value_base) {
  2707. _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
  2708. JNI_ABORT);
  2709. }
  2710. if (_exception) {
  2711. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2712. }
  2713. }
  2714. /* void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) */
  2715. static void
  2716. android_glUniform4uiv__IILjava_nio_IntBuffer_2
  2717. (JNIEnv *_env, jobject _this, jint location, jint count, jobject value_buf) {
  2718. jintArray _array = (jintArray) 0;
  2719. jint _bufferOffset = (jint) 0;
  2720. jint _remaining;
  2721. GLuint *value = (GLuint *) 0;
  2722. value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2723. if (value == NULL) {
  2724. char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2725. value = (GLuint *) (_valueBase + _bufferOffset);
  2726. }
  2727. glUniform4uiv(
  2728. (GLint)location,
  2729. (GLsizei)count,
  2730. (GLuint *)value
  2731. );
  2732. if (_array) {
  2733. _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
  2734. }
  2735. }
  2736. /* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
  2737. static void
  2738. android_glClearBufferiv__II_3II
  2739. (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
  2740. jint _exception = 0;
  2741. const char * _exceptionType = NULL;
  2742. const char * _exceptionMessage = NULL;
  2743. GLint *value_base = (GLint *) 0;
  2744. jint _remaining;
  2745. GLint *value = (GLint *) 0;
  2746. if (!value_ref) {
  2747. _exception = 1;
  2748. _exceptionType = "java/lang/IllegalArgumentException";
  2749. _exceptionMessage = "value == null";
  2750. goto exit;
  2751. }
  2752. if (offset < 0) {
  2753. _exception = 1;
  2754. _exceptionType = "java/lang/IllegalArgumentException";
  2755. _exceptionMessage = "offset < 0";
  2756. goto exit;
  2757. }
  2758. _remaining = _env->GetArrayLength(value_ref) - offset;
  2759. value_base = (GLint *)
  2760. _env->GetIntArrayElements(value_ref, (jboolean *)0);
  2761. value = value_base + offset;
  2762. glClearBufferiv(
  2763. (GLenum)buffer,
  2764. (GLint)drawbuffer,
  2765. (GLint *)value
  2766. );
  2767. exit:
  2768. if (value_base) {
  2769. _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
  2770. JNI_ABORT);
  2771. }
  2772. if (_exception) {
  2773. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2774. }
  2775. }
  2776. /* void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) */
  2777. static void
  2778. android_glClearBufferiv__IILjava_nio_IntBuffer_2
  2779. (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
  2780. jintArray _array = (jintArray) 0;
  2781. jint _bufferOffset = (jint) 0;
  2782. jint _remaining;
  2783. GLint *value = (GLint *) 0;
  2784. value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2785. if (value == NULL) {
  2786. char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2787. value = (GLint *) (_valueBase + _bufferOffset);
  2788. }
  2789. glClearBufferiv(
  2790. (GLenum)buffer,
  2791. (GLint)drawbuffer,
  2792. (GLint *)value
  2793. );
  2794. if (_array) {
  2795. _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
  2796. }
  2797. }
  2798. /* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
  2799. static void
  2800. android_glClearBufferuiv__II_3II
  2801. (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jintArray value_ref, jint offset) {
  2802. jint _exception = 0;
  2803. const char * _exceptionType = NULL;
  2804. const char * _exceptionMessage = NULL;
  2805. GLuint *value_base = (GLuint *) 0;
  2806. jint _remaining;
  2807. GLuint *value = (GLuint *) 0;
  2808. if (!value_ref) {
  2809. _exception = 1;
  2810. _exceptionType = "java/lang/IllegalArgumentException";
  2811. _exceptionMessage = "value == null";
  2812. goto exit;
  2813. }
  2814. if (offset < 0) {
  2815. _exception = 1;
  2816. _exceptionType = "java/lang/IllegalArgumentException";
  2817. _exceptionMessage = "offset < 0";
  2818. goto exit;
  2819. }
  2820. _remaining = _env->GetArrayLength(value_ref) - offset;
  2821. value_base = (GLuint *)
  2822. _env->GetIntArrayElements(value_ref, (jboolean *)0);
  2823. value = value_base + offset;
  2824. glClearBufferuiv(
  2825. (GLenum)buffer,
  2826. (GLint)drawbuffer,
  2827. (GLuint *)value
  2828. );
  2829. exit:
  2830. if (value_base) {
  2831. _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
  2832. JNI_ABORT);
  2833. }
  2834. if (_exception) {
  2835. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2836. }
  2837. }
  2838. /* void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) */
  2839. static void
  2840. android_glClearBufferuiv__IILjava_nio_IntBuffer_2
  2841. (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
  2842. jintArray _array = (jintArray) 0;
  2843. jint _bufferOffset = (jint) 0;
  2844. jint _remaining;
  2845. GLuint *value = (GLuint *) 0;
  2846. value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2847. if (value == NULL) {
  2848. char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  2849. value = (GLuint *) (_valueBase + _bufferOffset);
  2850. }
  2851. glClearBufferuiv(
  2852. (GLenum)buffer,
  2853. (GLint)drawbuffer,
  2854. (GLuint *)value
  2855. );
  2856. if (_array) {
  2857. _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
  2858. }
  2859. }
  2860. /* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
  2861. static void
  2862. android_glClearBufferfv__II_3FI
  2863. (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloatArray value_ref, jint offset) {
  2864. jint _exception = 0;
  2865. const char * _exceptionType = NULL;
  2866. const char * _exceptionMessage = NULL;
  2867. GLfloat *value_base = (GLfloat *) 0;
  2868. jint _remaining;
  2869. GLfloat *value = (GLfloat *) 0;
  2870. if (!value_ref) {
  2871. _exception = 1;
  2872. _exceptionType = "java/lang/IllegalArgumentException";
  2873. _exceptionMessage = "value == null";
  2874. goto exit;
  2875. }
  2876. if (offset < 0) {
  2877. _exception = 1;
  2878. _exceptionType = "java/lang/IllegalArgumentException";
  2879. _exceptionMessage = "offset < 0";
  2880. goto exit;
  2881. }
  2882. _remaining = _env->GetArrayLength(value_ref) - offset;
  2883. value_base = (GLfloat *)
  2884. _env->GetFloatArrayElements(value_ref, (jboolean *)0);
  2885. value = value_base + offset;
  2886. glClearBufferfv(
  2887. (GLenum)buffer,
  2888. (GLint)drawbuffer,
  2889. (GLfloat *)value
  2890. );
  2891. exit:
  2892. if (value_base) {
  2893. _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
  2894. JNI_ABORT);
  2895. }
  2896. if (_exception) {
  2897. jniThrowException(_env, _exceptionType, _exceptionMessage);
  2898. }
  2899. }
  2900. /* void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) */
  2901. static void
  2902. android_glClearBufferfv__IILjava_nio_FloatBuffer_2
  2903. (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jobject value_buf) {
  2904. jfloatArray _array = (jfloatArray) 0;
  2905. jint _bufferOffset = (jint) 0;
  2906. jint _remaining;
  2907. GLfloat *value = (GLfloat *) 0;
  2908. value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  2909. if (value == NULL) {
  2910. char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
  2911. value = (GLfloat *) (_valueBase + _bufferOffset);
  2912. }
  2913. glClearBufferfv(
  2914. (GLenum)buffer,
  2915. (GLint)drawbuffer,
  2916. (GLfloat *)value
  2917. );
  2918. if (_array) {
  2919. _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
  2920. }
  2921. }
  2922. /* void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) */
  2923. static void
  2924. android_glClearBufferfi__IIFI
  2925. (JNIEnv *_env, jobject _this, jint buffer, jint drawbuffer, jfloat depth, jint stencil) {
  2926. glClearBufferfi(
  2927. (GLenum)buffer,
  2928. (GLint)drawbuffer,
  2929. (GLfloat)depth,
  2930. (GLint)stencil
  2931. );
  2932. }
  2933. /* const GLubyte * glGetStringi ( GLenum name, GLuint index ) */
  2934. static jstring
  2935. android_glGetStringi__II
  2936. (JNIEnv *_env, jobject _this, jint name, jint index) {
  2937. const GLubyte* _chars = glGetStringi((GLenum)name, (GLuint)index);
  2938. return _env->NewStringUTF((const char*)_chars);
  2939. }
  2940. /* void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) */
  2941. static void
  2942. android_glCopyBufferSubData__IIIII
  2943. (JNIEnv *_env, jobject _this, jint readTarget, jint writeTarget, jint readOffset, jint writeOffset, jint size) {
  2944. glCopyBufferSubData(
  2945. (GLenum)readTarget,
  2946. (GLenum)writeTarget,
  2947. (GLintptr)readOffset,
  2948. (GLintptr)writeOffset,
  2949. (GLsizeiptr)size
  2950. );
  2951. }
  2952. /* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
  2953. static
  2954. void
  2955. android_glGetUniformIndices_array
  2956. (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jintArray uniformIndices_ref, jint uniformIndicesOffset) {
  2957. jint _exception = 0;
  2958. const char* _exceptionType = NULL;
  2959. const char* _exceptionMessage = NULL;
  2960. jint _count = 0;
  2961. jint _i;
  2962. const char** _names = NULL;
  2963. GLuint* _indices_base = NULL;
  2964. GLuint* _indices = NULL;
  2965. if (!uniformNames_ref) {
  2966. _exception = 1;
  2967. _exceptionType = "java/lang/IllegalArgumentException";
  2968. _exceptionMessage = "uniformNames == null";
  2969. goto exit;
  2970. }
  2971. _count = _env->GetArrayLength(uniformNames_ref);
  2972. _names = (const char**)calloc(_count, sizeof(const char*));
  2973. for (_i = 0; _i < _count; _i++) {
  2974. jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
  2975. if (!_name) {
  2976. _exception = 1;
  2977. _exceptionType = "java/lang/IllegalArgumentException";
  2978. _exceptionMessage = "null uniformNames element";
  2979. goto exit;
  2980. }
  2981. _names[_i] = _env->GetStringUTFChars(_name, 0);
  2982. }
  2983. if (!uniformIndices_ref) {
  2984. _exception = 1;
  2985. _exceptionType = "java/lang/IllegalArgumentException";
  2986. _exceptionMessage = "uniformIndices == null";
  2987. goto exit;
  2988. }
  2989. if (uniformIndicesOffset < 0) {
  2990. _exception = 1;
  2991. _exceptionType = "java/lang/IllegalArgumentException";
  2992. _exceptionMessage = "uniformIndicesOffset < 0";
  2993. goto exit;
  2994. }
  2995. if (_env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset < _count) {
  2996. _exception = 1;
  2997. _exceptionType = "java/lang/IllegalArgumentException";
  2998. _exceptionMessage = "not enough space in uniformIndices";
  2999. goto exit;
  3000. }
  3001. _indices_base = (GLuint*)_env->GetIntArrayElements(
  3002. uniformIndices_ref, 0);
  3003. _indices = _indices_base + uniformIndicesOffset;
  3004. glGetUniformIndices(program, _count, _names, _indices);
  3005. exit:
  3006. if (_indices_base) {
  3007. _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)_indices_base,
  3008. _exception ? JNI_ABORT : 0);
  3009. }
  3010. for (_i = _count - 1; _i >= 0; _i--) {
  3011. if (_names[_i]) {
  3012. jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
  3013. if (_name) {
  3014. _env->ReleaseStringUTFChars(_name, _names[_i]);
  3015. }
  3016. }
  3017. }
  3018. free(_names);
  3019. if (_exception) {
  3020. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3021. }
  3022. }
  3023. /* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */
  3024. static
  3025. void
  3026. android_glGetUniformIndices_buffer
  3027. (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jobject uniformIndices_buf) {
  3028. jint _exception = 0;
  3029. const char* _exceptionType = NULL;
  3030. const char* _exceptionMessage = NULL;
  3031. jint _count = 0;
  3032. jint _i;
  3033. const char** _names = NULL;
  3034. jintArray _uniformIndicesArray = (jintArray)0;
  3035. jint _uniformIndicesRemaining;
  3036. jint _uniformIndicesOffset = 0;
  3037. GLuint* _indices = NULL;
  3038. char* _indicesBase = NULL;
  3039. if (!uniformNames_ref) {
  3040. _exception = 1;
  3041. _exceptionType = "java/lang/IllegalArgumentException";
  3042. _exceptionMessage = "uniformNames == null";
  3043. goto exit;
  3044. }
  3045. if (!uniformIndices_buf) {
  3046. _exception = 1;
  3047. _exceptionType = "java/lang/IllegalArgumentException";
  3048. _exceptionMessage = "uniformIndices == null";
  3049. goto exit;
  3050. }
  3051. _count = _env->GetArrayLength(uniformNames_ref);
  3052. _names = (const char**)calloc(_count, sizeof(const char*));
  3053. for (_i = 0; _i < _count; _i++) {
  3054. jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
  3055. if (!_name) {
  3056. _exception = 1;
  3057. _exceptionType = "java/lang/IllegalArgumentException";
  3058. _exceptionMessage = "null uniformNames element";
  3059. goto exit;
  3060. }
  3061. _names[_i] = _env->GetStringUTFChars(_name, 0);
  3062. }
  3063. _indices = (GLuint*)getPointer(_env, uniformIndices_buf,
  3064. (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining,
  3065. &_uniformIndicesOffset);
  3066. if (!_indices) {
  3067. _indicesBase = (char*)_env->GetIntArrayElements(
  3068. _uniformIndicesArray, 0);
  3069. _indices = (GLuint*)(_indicesBase + _uniformIndicesOffset);
  3070. }
  3071. if (_uniformIndicesRemaining < _count) {
  3072. _exception = 1;
  3073. _exceptionType = "java/lang/IllegalArgumentException";
  3074. _exceptionMessage = "not enough space in uniformIndices";
  3075. goto exit;
  3076. }
  3077. glGetUniformIndices(program, _count, _names, _indices);
  3078. exit:
  3079. if (_uniformIndicesArray) {
  3080. releaseArrayPointer<jintArray, jint*, IntArrayReleaser>(
  3081. _env, _uniformIndicesArray, (jint*)_indicesBase, JNI_TRUE);
  3082. }
  3083. for (_i = _count - 1; _i >= 0; _i--) {
  3084. if (_names[_i]) {
  3085. jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i);
  3086. if (_name) {
  3087. _env->ReleaseStringUTFChars(_name, _names[_i]);
  3088. }
  3089. }
  3090. }
  3091. free(_names);
  3092. if (_exception) {
  3093. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3094. }
  3095. }
  3096. /* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
  3097. static void
  3098. android_glGetActiveUniformsiv__II_3III_3II
  3099. (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jintArray uniformIndices_ref, jint uniformIndicesOffset, jint pname, jintArray params_ref, jint paramsOffset) {
  3100. jint _exception = 0;
  3101. const char * _exceptionType = NULL;
  3102. const char * _exceptionMessage = NULL;
  3103. GLuint *uniformIndices_base = (GLuint *) 0;
  3104. jint _uniformIndicesRemaining;
  3105. GLuint *uniformIndices = (GLuint *) 0;
  3106. GLint *params_base = (GLint *) 0;
  3107. jint _paramsRemaining;
  3108. GLint *params = (GLint *) 0;
  3109. if (!uniformIndices_ref) {
  3110. _exception = 1;
  3111. _exceptionType = "java/lang/IllegalArgumentException";
  3112. _exceptionMessage = "uniformIndices == null";
  3113. goto exit;
  3114. }
  3115. if (uniformIndicesOffset < 0) {
  3116. _exception = 1;
  3117. _exceptionType = "java/lang/IllegalArgumentException";
  3118. _exceptionMessage = "uniformIndicesOffset < 0";
  3119. goto exit;
  3120. }
  3121. _uniformIndicesRemaining = _env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset;
  3122. uniformIndices_base = (GLuint *)
  3123. _env->GetIntArrayElements(uniformIndices_ref, (jboolean *)0);
  3124. uniformIndices = uniformIndices_base + uniformIndicesOffset;
  3125. if (!params_ref) {
  3126. _exception = 1;
  3127. _exceptionType = "java/lang/IllegalArgumentException";
  3128. _exceptionMessage = "params == null";
  3129. goto exit;
  3130. }
  3131. if (paramsOffset < 0) {
  3132. _exception = 1;
  3133. _exceptionType = "java/lang/IllegalArgumentException";
  3134. _exceptionMessage = "paramsOffset < 0";
  3135. goto exit;
  3136. }
  3137. _paramsRemaining = _env->GetArrayLength(params_ref) - paramsOffset;
  3138. params_base = (GLint *)
  3139. _env->GetIntArrayElements(params_ref, (jboolean *)0);
  3140. params = params_base + paramsOffset;
  3141. glGetActiveUniformsiv(
  3142. (GLuint)program,
  3143. (GLsizei)uniformCount,
  3144. (GLuint *)uniformIndices,
  3145. (GLenum)pname,
  3146. (GLint *)params
  3147. );
  3148. exit:
  3149. if (params_base) {
  3150. _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
  3151. _exception ? JNI_ABORT: 0);
  3152. }
  3153. if (uniformIndices_base) {
  3154. _env->ReleaseIntArrayElements(uniformIndices_ref, (jint*)uniformIndices_base,
  3155. JNI_ABORT);
  3156. }
  3157. if (_exception) {
  3158. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3159. }
  3160. }
  3161. /* void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) */
  3162. static void
  3163. android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2
  3164. (JNIEnv *_env, jobject _this, jint program, jint uniformCount, jobject uniformIndices_buf, jint pname, jobject params_buf) {
  3165. jintArray _uniformIndicesArray = (jintArray) 0;
  3166. jint _uniformIndicesBufferOffset = (jint) 0;
  3167. jintArray _paramsArray = (jintArray) 0;
  3168. jint _paramsBufferOffset = (jint) 0;
  3169. jint _uniformIndicesRemaining;
  3170. GLuint *uniformIndices = (GLuint *) 0;
  3171. jint _paramsRemaining;
  3172. GLint *params = (GLint *) 0;
  3173. uniformIndices = (GLuint *)getPointer(_env, uniformIndices_buf, (jarray*)&_uniformIndicesArray, &_uniformIndicesRemaining, &_uniformIndicesBufferOffset);
  3174. params = (GLint *)getPointer(_env, params_buf, (jarray*)&_paramsArray, &_paramsRemaining, &_paramsBufferOffset);
  3175. if (uniformIndices == NULL) {
  3176. char * _uniformIndicesBase = (char *)_env->GetIntArrayElements(_uniformIndicesArray, (jboolean *) 0);
  3177. uniformIndices = (GLuint *) (_uniformIndicesBase + _uniformIndicesBufferOffset);
  3178. }
  3179. if (params == NULL) {
  3180. char * _paramsBase = (char *)_env->GetIntArrayElements(_paramsArray, (jboolean *) 0);
  3181. params = (GLint *) (_paramsBase + _paramsBufferOffset);
  3182. }
  3183. glGetActiveUniformsiv(
  3184. (GLuint)program,
  3185. (GLsizei)uniformCount,
  3186. (GLuint *)uniformIndices,
  3187. (GLenum)pname,
  3188. (GLint *)params
  3189. );
  3190. if (_paramsArray) {
  3191. _env->ReleaseIntArrayElements(_paramsArray, (jint*)params, 0);
  3192. }
  3193. if (_uniformIndicesArray) {
  3194. _env->ReleaseIntArrayElements(_uniformIndicesArray, (jint*)uniformIndices, JNI_ABORT);
  3195. }
  3196. }
  3197. /* GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) */
  3198. static jint
  3199. android_glGetUniformBlockIndex__ILjava_lang_String_2
  3200. (JNIEnv *_env, jobject _this, jint program, jstring uniformBlockName) {
  3201. jint _exception = 0;
  3202. const char * _exceptionType = NULL;
  3203. const char * _exceptionMessage = NULL;
  3204. GLuint _returnValue = 0;
  3205. const char* _nativeuniformBlockName = 0;
  3206. if (!uniformBlockName) {
  3207. _exception = 1;
  3208. _exceptionType = "java/lang/IllegalArgumentException";
  3209. _exceptionMessage = "uniformBlockName == null";
  3210. goto exit;
  3211. }
  3212. _nativeuniformBlockName = _env->GetStringUTFChars(uniformBlockName, 0);
  3213. _returnValue = glGetUniformBlockIndex(
  3214. (GLuint)program,
  3215. (GLchar *)_nativeuniformBlockName
  3216. );
  3217. exit:
  3218. if (_nativeuniformBlockName) {
  3219. _env->ReleaseStringUTFChars(uniformBlockName, _nativeuniformBlockName);
  3220. }
  3221. if (_exception) {
  3222. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3223. }
  3224. return (jint)_returnValue;
  3225. }
  3226. /* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
  3227. static void
  3228. android_glGetActiveUniformBlockiv__III_3II
  3229. (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jintArray params_ref, jint offset) {
  3230. jint _exception = 0;
  3231. const char * _exceptionType = NULL;
  3232. const char * _exceptionMessage = NULL;
  3233. GLint *params_base = (GLint *) 0;
  3234. jint _remaining;
  3235. GLint *params = (GLint *) 0;
  3236. if (!params_ref) {
  3237. _exception = 1;
  3238. _exceptionType = "java/lang/IllegalArgumentException";
  3239. _exceptionMessage = "params == null";
  3240. goto exit;
  3241. }
  3242. if (offset < 0) {
  3243. _exception = 1;
  3244. _exceptionType = "java/lang/IllegalArgumentException";
  3245. _exceptionMessage = "offset < 0";
  3246. goto exit;
  3247. }
  3248. _remaining = _env->GetArrayLength(params_ref) - offset;
  3249. params_base = (GLint *)
  3250. _env->GetIntArrayElements(params_ref, (jboolean *)0);
  3251. params = params_base + offset;
  3252. glGetActiveUniformBlockiv(
  3253. (GLuint)program,
  3254. (GLuint)uniformBlockIndex,
  3255. (GLenum)pname,
  3256. (GLint *)params
  3257. );
  3258. exit:
  3259. if (params_base) {
  3260. _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
  3261. _exception ? JNI_ABORT: 0);
  3262. }
  3263. if (_exception) {
  3264. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3265. }
  3266. }
  3267. /* void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) */
  3268. static void
  3269. android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2
  3270. (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint pname, jobject params_buf) {
  3271. jintArray _array = (jintArray) 0;
  3272. jint _bufferOffset = (jint) 0;
  3273. jint _remaining;
  3274. GLint *params = (GLint *) 0;
  3275. params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  3276. if (params == NULL) {
  3277. char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  3278. params = (GLint *) (_paramsBase + _bufferOffset);
  3279. }
  3280. glGetActiveUniformBlockiv(
  3281. (GLuint)program,
  3282. (GLuint)uniformBlockIndex,
  3283. (GLenum)pname,
  3284. (GLint *)params
  3285. );
  3286. if (_array) {
  3287. _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
  3288. }
  3289. }
  3290. /* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
  3291. static void
  3292. android_glGetActiveUniformBlockName_III_3II_3BI
  3293. (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, int bufSize, jintArray length_ref, jint lengthOffset, jbyteArray name_ref, jint nameOffset) {
  3294. jint _exception = 0;
  3295. const char* _exceptionType;
  3296. const char* _exceptionMessage;
  3297. GLsizei* _length_base = (GLsizei*)0;
  3298. jint _lengthRemaining;
  3299. GLsizei* _length = (GLsizei*)0;
  3300. GLchar* _name_base = (GLchar*)0;
  3301. jint _nameRemaining;
  3302. GLchar* _name = (GLchar*)0;
  3303. if (length_ref) {
  3304. if (lengthOffset < 0) {
  3305. _exception = 1;
  3306. _exceptionType = "java/lang/IllegalArgumentException";
  3307. _exceptionMessage = "lengthOffset < 0";
  3308. goto exit;
  3309. }
  3310. _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
  3311. _length_base = (GLsizei*)_env->GetIntArrayElements(
  3312. length_ref, (jboolean*)0);
  3313. _length = _length_base + lengthOffset;
  3314. }
  3315. if (!name_ref) {
  3316. _exception = 1;
  3317. _exceptionType = "java/lang/IllegalArgumentException";
  3318. _exceptionMessage = "uniformBlockName == null";
  3319. goto exit;
  3320. }
  3321. if (nameOffset < 0) {
  3322. _exception = 1;
  3323. _exceptionType = "java/lang/IllegalArgumentException";
  3324. _exceptionMessage = "uniformBlockNameOffset < 0";
  3325. goto exit;
  3326. }
  3327. _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset;
  3328. _name_base = (GLchar*)_env->GetByteArrayElements(
  3329. name_ref, (jboolean*)0);
  3330. _name = _name_base + nameOffset;
  3331. glGetActiveUniformBlockName(
  3332. (GLuint)program,
  3333. (GLuint)uniformBlockIndex,
  3334. (GLsizei)bufSize,
  3335. (GLsizei*)_length,
  3336. (GLchar*)_name
  3337. );
  3338. exit:
  3339. if (_name_base) {
  3340. _env->ReleaseByteArrayElements(name_ref, (jbyte*)_name_base,
  3341. _exception ? JNI_ABORT: 0);
  3342. }
  3343. if (_length_base) {
  3344. _env->ReleaseIntArrayElements(length_ref, (jint*)_length_base,
  3345. _exception ? JNI_ABORT: 0);
  3346. }
  3347. if (_exception) {
  3348. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3349. }
  3350. }
  3351. /* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
  3352. static void
  3353. android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2
  3354. (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, jobject length_buf, jobject uniformBlockName_buf) {
  3355. jint _exception = 0;
  3356. const char* _exceptionType;
  3357. const char* _exceptionMessage;
  3358. jarray _lengthArray = (jarray)0;
  3359. jint _lengthBufferOffset = (jint)0;
  3360. GLsizei* _length = (GLsizei*)0;
  3361. jint _lengthRemaining;
  3362. jarray _nameArray = (jarray)0;
  3363. jint _nameBufferOffset = (jint)0;
  3364. GLchar* _name = (GLchar*)0;
  3365. jint _nameRemaining;
  3366. _length = (GLsizei*)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
  3367. if (_length == NULL) {
  3368. GLsizei* _lengthBase = (GLsizei*)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean*)0);
  3369. _length = (GLsizei*)(_lengthBase + _lengthBufferOffset);
  3370. }
  3371. _name = (GLchar*)getPointer(_env, uniformBlockName_buf, &_nameArray, &_nameRemaining, &_nameBufferOffset);
  3372. if (_name == NULL) {
  3373. GLchar* _nameBase = (GLchar*)_env->GetPrimitiveArrayCritical(_nameArray, (jboolean*)0);
  3374. _name = (GLchar*)(_nameBase + _nameBufferOffset);
  3375. }
  3376. glGetActiveUniformBlockName(
  3377. (GLuint)program,
  3378. (GLuint)uniformBlockIndex,
  3379. (GLsizei)_nameRemaining,
  3380. _length, _name
  3381. );
  3382. if (_nameArray) {
  3383. releasePointer(_env, _nameArray, _name, JNI_TRUE);
  3384. }
  3385. if (_lengthArray) {
  3386. releasePointer(_env, _lengthArray, _length, JNI_TRUE);
  3387. }
  3388. }
  3389. /* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */
  3390. static jstring
  3391. android_glGetActiveUniformBlockName_II
  3392. (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex) {
  3393. GLint len = 0;
  3394. glGetActiveUniformBlockiv((GLuint)program, (GLuint)uniformBlockIndex,
  3395. GL_UNIFORM_BLOCK_NAME_LENGTH, &len);
  3396. GLchar* name = (GLchar*)malloc(len);
  3397. glGetActiveUniformBlockName((GLuint)program, (GLuint)uniformBlockIndex,
  3398. len, NULL, name);
  3399. jstring result = _env->NewStringUTF(name);
  3400. free(name);
  3401. return result;
  3402. }
  3403. /* void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) */
  3404. static void
  3405. android_glUniformBlockBinding__III
  3406. (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex, jint uniformBlockBinding) {
  3407. glUniformBlockBinding(
  3408. (GLuint)program,
  3409. (GLuint)uniformBlockIndex,
  3410. (GLuint)uniformBlockBinding
  3411. );
  3412. }
  3413. /* void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) */
  3414. static void
  3415. android_glDrawArraysInstanced__IIII
  3416. (JNIEnv *_env, jobject _this, jint mode, jint first, jint count, jint instanceCount) {
  3417. glDrawArraysInstanced(
  3418. (GLenum)mode,
  3419. (GLint)first,
  3420. (GLsizei)count,
  3421. (GLsizei)instanceCount
  3422. );
  3423. }
  3424. /* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
  3425. static void
  3426. android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I
  3427. (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount) {
  3428. jarray _array = (jarray) 0;
  3429. jint _bufferOffset = (jint) 0;
  3430. jint _remaining;
  3431. GLvoid *indices = (GLvoid *) 0;
  3432. indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset);
  3433. if (indices == NULL) {
  3434. char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
  3435. indices = (GLvoid *) (_indicesBase + _bufferOffset);
  3436. }
  3437. glDrawElementsInstanced(
  3438. (GLenum)mode,
  3439. (GLsizei)count,
  3440. (GLenum)type,
  3441. (GLvoid *)indices,
  3442. (GLsizei)instanceCount
  3443. );
  3444. if (_array) {
  3445. releasePointer(_env, _array, indices, JNI_FALSE);
  3446. }
  3447. }
  3448. /* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */
  3449. static void
  3450. android_glDrawElementsInstanced__IIIII
  3451. (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount) {
  3452. glDrawElementsInstanced(
  3453. (GLenum)mode,
  3454. (GLsizei)count,
  3455. (GLenum)type,
  3456. (GLvoid *)static_cast<uintptr_t>(indicesOffset),
  3457. (GLsizei)instanceCount
  3458. );
  3459. }
  3460. /* GLsync glFenceSync ( GLenum condition, GLbitfield flags ) */
  3461. static jlong
  3462. android_glFenceSync__II
  3463. (JNIEnv *_env, jobject _this, jint condition, jint flags) {
  3464. GLsync _returnValue;
  3465. _returnValue = glFenceSync(
  3466. (GLenum)condition,
  3467. (GLbitfield)flags
  3468. );
  3469. return (jlong)_returnValue;
  3470. }
  3471. /* GLboolean glIsSync ( GLsync sync ) */
  3472. static jboolean
  3473. android_glIsSync__J
  3474. (JNIEnv *_env, jobject _this, jlong sync) {
  3475. GLboolean _returnValue;
  3476. _returnValue = glIsSync(
  3477. (GLsync)sync
  3478. );
  3479. return (jboolean)_returnValue;
  3480. }
  3481. /* void glDeleteSync ( GLsync sync ) */
  3482. static void
  3483. android_glDeleteSync__J
  3484. (JNIEnv *_env, jobject _this, jlong sync) {
  3485. glDeleteSync(
  3486. (GLsync)sync
  3487. );
  3488. }
  3489. /* GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
  3490. static jint
  3491. android_glClientWaitSync__JIJ
  3492. (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
  3493. GLenum _returnValue;
  3494. _returnValue = glClientWaitSync(
  3495. (GLsync)sync,
  3496. (GLbitfield)flags,
  3497. (GLuint64)timeout
  3498. );
  3499. return (jint)_returnValue;
  3500. }
  3501. /* void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) */
  3502. static void
  3503. android_glWaitSync__JIJ
  3504. (JNIEnv *_env, jobject _this, jlong sync, jint flags, jlong timeout) {
  3505. glWaitSync(
  3506. (GLsync)sync,
  3507. (GLbitfield)flags,
  3508. (GLuint64)timeout
  3509. );
  3510. }
  3511. /* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
  3512. static void
  3513. android_glGetInteger64v__I_3JI
  3514. (JNIEnv *_env, jobject _this, jint pname, jlongArray params_ref, jint offset) {
  3515. jint _exception = 0;
  3516. const char * _exceptionType = NULL;
  3517. const char * _exceptionMessage = NULL;
  3518. GLint64 *params_base = (GLint64 *) 0;
  3519. jint _remaining;
  3520. GLint64 *params = (GLint64 *) 0;
  3521. if (!params_ref) {
  3522. _exception = 1;
  3523. _exceptionType = "java/lang/IllegalArgumentException";
  3524. _exceptionMessage = "params == null";
  3525. goto exit;
  3526. }
  3527. if (offset < 0) {
  3528. _exception = 1;
  3529. _exceptionType = "java/lang/IllegalArgumentException";
  3530. _exceptionMessage = "offset < 0";
  3531. goto exit;
  3532. }
  3533. _remaining = _env->GetArrayLength(params_ref) - offset;
  3534. params_base = (GLint64 *)
  3535. _env->GetLongArrayElements(params_ref, (jboolean *)0);
  3536. params = params_base + offset;
  3537. glGetInteger64v(
  3538. (GLenum)pname,
  3539. (GLint64 *)params
  3540. );
  3541. exit:
  3542. if (params_base) {
  3543. _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
  3544. _exception ? JNI_ABORT: 0);
  3545. }
  3546. if (_exception) {
  3547. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3548. }
  3549. }
  3550. /* void glGetInteger64v ( GLenum pname, GLint64 *params ) */
  3551. static void
  3552. android_glGetInteger64v__ILjava_nio_LongBuffer_2
  3553. (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
  3554. jlongArray _array = (jlongArray) 0;
  3555. jint _bufferOffset = (jint) 0;
  3556. jint _remaining;
  3557. GLint64 *params = (GLint64 *) 0;
  3558. params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  3559. if (params == NULL) {
  3560. char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
  3561. params = (GLint64 *) (_paramsBase + _bufferOffset);
  3562. }
  3563. glGetInteger64v(
  3564. (GLenum)pname,
  3565. (GLint64 *)params
  3566. );
  3567. if (_array) {
  3568. _env->ReleaseLongArrayElements(_array, (jlong*)params, 0);
  3569. }
  3570. }
  3571. /* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
  3572. static void
  3573. android_glGetSynciv__JII_3II_3II
  3574. (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray values_ref, jint valuesOffset) {
  3575. jint _exception = 0;
  3576. const char * _exceptionType = NULL;
  3577. const char * _exceptionMessage = NULL;
  3578. GLsizei *length_base = (GLsizei *) 0;
  3579. jint _lengthRemaining;
  3580. GLsizei *length = (GLsizei *) 0;
  3581. GLint *values_base = (GLint *) 0;
  3582. jint _valuesRemaining;
  3583. GLint *values = (GLint *) 0;
  3584. if (length_ref) {
  3585. if (lengthOffset < 0) {
  3586. _exception = 1;
  3587. _exceptionType = "java/lang/IllegalArgumentException";
  3588. _exceptionMessage = "lengthOffset < 0";
  3589. goto exit;
  3590. }
  3591. _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
  3592. length_base = (GLsizei *)
  3593. _env->GetIntArrayElements(length_ref, (jboolean *)0);
  3594. length = length_base + lengthOffset;
  3595. }
  3596. if (!values_ref) {
  3597. _exception = 1;
  3598. _exceptionType = "java/lang/IllegalArgumentException";
  3599. _exceptionMessage = "values == null";
  3600. goto exit;
  3601. }
  3602. if (valuesOffset < 0) {
  3603. _exception = 1;
  3604. _exceptionType = "java/lang/IllegalArgumentException";
  3605. _exceptionMessage = "valuesOffset < 0";
  3606. goto exit;
  3607. }
  3608. _valuesRemaining = _env->GetArrayLength(values_ref) - valuesOffset;
  3609. values_base = (GLint *)
  3610. _env->GetIntArrayElements(values_ref, (jboolean *)0);
  3611. values = values_base + valuesOffset;
  3612. glGetSynciv(
  3613. (GLsync)sync,
  3614. (GLenum)pname,
  3615. (GLsizei)bufSize,
  3616. (GLsizei *)length,
  3617. (GLint *)values
  3618. );
  3619. exit:
  3620. if (values_base) {
  3621. _env->ReleaseIntArrayElements(values_ref, (jint*)values_base,
  3622. _exception ? JNI_ABORT: 0);
  3623. }
  3624. if (length_base) {
  3625. _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
  3626. _exception ? JNI_ABORT: 0);
  3627. }
  3628. if (_exception) {
  3629. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3630. }
  3631. }
  3632. /* void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) */
  3633. static void
  3634. android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
  3635. (JNIEnv *_env, jobject _this, jlong sync, jint pname, jint bufSize, jobject length_buf, jobject values_buf) {
  3636. jintArray _lengthArray = (jintArray) 0;
  3637. jint _lengthBufferOffset = (jint) 0;
  3638. jintArray _valuesArray = (jintArray) 0;
  3639. jint _valuesBufferOffset = (jint) 0;
  3640. jint _lengthRemaining;
  3641. GLsizei *length = (GLsizei *) 0;
  3642. jint _valuesRemaining;
  3643. GLint *values = (GLint *) 0;
  3644. if (length_buf) {
  3645. length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
  3646. }
  3647. values = (GLint *)getPointer(_env, values_buf, (jarray*)&_valuesArray, &_valuesRemaining, &_valuesBufferOffset);
  3648. if (length_buf && length == NULL) {
  3649. char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
  3650. length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
  3651. }
  3652. if (values == NULL) {
  3653. char * _valuesBase = (char *)_env->GetIntArrayElements(_valuesArray, (jboolean *) 0);
  3654. values = (GLint *) (_valuesBase + _valuesBufferOffset);
  3655. }
  3656. glGetSynciv(
  3657. (GLsync)sync,
  3658. (GLenum)pname,
  3659. (GLsizei)bufSize,
  3660. (GLsizei *)length,
  3661. (GLint *)values
  3662. );
  3663. if (_valuesArray) {
  3664. _env->ReleaseIntArrayElements(_valuesArray, (jint*)values, 0);
  3665. }
  3666. if (_lengthArray) {
  3667. _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, 0);
  3668. }
  3669. }
  3670. /* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
  3671. static void
  3672. android_glGetInteger64i_v__II_3JI
  3673. (JNIEnv *_env, jobject _this, jint target, jint index, jlongArray data_ref, jint offset) {
  3674. jint _exception = 0;
  3675. const char * _exceptionType = NULL;
  3676. const char * _exceptionMessage = NULL;
  3677. GLint64 *data_base = (GLint64 *) 0;
  3678. jint _remaining;
  3679. GLint64 *data = (GLint64 *) 0;
  3680. if (!data_ref) {
  3681. _exception = 1;
  3682. _exceptionType = "java/lang/IllegalArgumentException";
  3683. _exceptionMessage = "data == null";
  3684. goto exit;
  3685. }
  3686. if (offset < 0) {
  3687. _exception = 1;
  3688. _exceptionType = "java/lang/IllegalArgumentException";
  3689. _exceptionMessage = "offset < 0";
  3690. goto exit;
  3691. }
  3692. _remaining = _env->GetArrayLength(data_ref) - offset;
  3693. data_base = (GLint64 *)
  3694. _env->GetLongArrayElements(data_ref, (jboolean *)0);
  3695. data = data_base + offset;
  3696. glGetInteger64i_v(
  3697. (GLenum)target,
  3698. (GLuint)index,
  3699. (GLint64 *)data
  3700. );
  3701. exit:
  3702. if (data_base) {
  3703. _env->ReleaseLongArrayElements(data_ref, (jlong*)data_base,
  3704. _exception ? JNI_ABORT: 0);
  3705. }
  3706. if (_exception) {
  3707. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3708. }
  3709. }
  3710. /* void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) */
  3711. static void
  3712. android_glGetInteger64i_v__IILjava_nio_LongBuffer_2
  3713. (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
  3714. jlongArray _array = (jlongArray) 0;
  3715. jint _bufferOffset = (jint) 0;
  3716. jint _remaining;
  3717. GLint64 *data = (GLint64 *) 0;
  3718. data = (GLint64 *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  3719. if (data == NULL) {
  3720. char * _dataBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
  3721. data = (GLint64 *) (_dataBase + _bufferOffset);
  3722. }
  3723. glGetInteger64i_v(
  3724. (GLenum)target,
  3725. (GLuint)index,
  3726. (GLint64 *)data
  3727. );
  3728. if (_array) {
  3729. _env->ReleaseLongArrayElements(_array, (jlong*)data, 0);
  3730. }
  3731. }
  3732. /* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
  3733. static void
  3734. android_glGetBufferParameteri64v__II_3JI
  3735. (JNIEnv *_env, jobject _this, jint target, jint pname, jlongArray params_ref, jint offset) {
  3736. jint _exception = 0;
  3737. const char * _exceptionType = NULL;
  3738. const char * _exceptionMessage = NULL;
  3739. GLint64 *params_base = (GLint64 *) 0;
  3740. jint _remaining;
  3741. GLint64 *params = (GLint64 *) 0;
  3742. if (!params_ref) {
  3743. _exception = 1;
  3744. _exceptionType = "java/lang/IllegalArgumentException";
  3745. _exceptionMessage = "params == null";
  3746. goto exit;
  3747. }
  3748. if (offset < 0) {
  3749. _exception = 1;
  3750. _exceptionType = "java/lang/IllegalArgumentException";
  3751. _exceptionMessage = "offset < 0";
  3752. goto exit;
  3753. }
  3754. _remaining = _env->GetArrayLength(params_ref) - offset;
  3755. params_base = (GLint64 *)
  3756. _env->GetLongArrayElements(params_ref, (jboolean *)0);
  3757. params = params_base + offset;
  3758. glGetBufferParameteri64v(
  3759. (GLenum)target,
  3760. (GLenum)pname,
  3761. (GLint64 *)params
  3762. );
  3763. exit:
  3764. if (params_base) {
  3765. _env->ReleaseLongArrayElements(params_ref, (jlong*)params_base,
  3766. _exception ? JNI_ABORT: 0);
  3767. }
  3768. if (_exception) {
  3769. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3770. }
  3771. }
  3772. /* void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) */
  3773. static void
  3774. android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2
  3775. (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
  3776. jlongArray _array = (jlongArray) 0;
  3777. jint _bufferOffset = (jint) 0;
  3778. jint _remaining;
  3779. GLint64 *params = (GLint64 *) 0;
  3780. params = (GLint64 *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  3781. if (params == NULL) {
  3782. char * _paramsBase = (char *)_env->GetLongArrayElements(_array, (jboolean *) 0);
  3783. params = (GLint64 *) (_paramsBase + _bufferOffset);
  3784. }
  3785. glGetBufferParameteri64v(
  3786. (GLenum)target,
  3787. (GLenum)pname,
  3788. (GLint64 *)params
  3789. );
  3790. if (_array) {
  3791. _env->ReleaseLongArrayElements(_array, (jlong*)params, 0);
  3792. }
  3793. }
  3794. /* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
  3795. static void
  3796. android_glGenSamplers__I_3II
  3797. (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
  3798. jint _exception = 0;
  3799. const char * _exceptionType = NULL;
  3800. const char * _exceptionMessage = NULL;
  3801. GLuint *samplers_base = (GLuint *) 0;
  3802. jint _remaining;
  3803. GLuint *samplers = (GLuint *) 0;
  3804. if (!samplers_ref) {
  3805. _exception = 1;
  3806. _exceptionType = "java/lang/IllegalArgumentException";
  3807. _exceptionMessage = "samplers == null";
  3808. goto exit;
  3809. }
  3810. if (offset < 0) {
  3811. _exception = 1;
  3812. _exceptionType = "java/lang/IllegalArgumentException";
  3813. _exceptionMessage = "offset < 0";
  3814. goto exit;
  3815. }
  3816. _remaining = _env->GetArrayLength(samplers_ref) - offset;
  3817. samplers_base = (GLuint *)
  3818. _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
  3819. samplers = samplers_base + offset;
  3820. glGenSamplers(
  3821. (GLsizei)count,
  3822. (GLuint *)samplers
  3823. );
  3824. exit:
  3825. if (samplers_base) {
  3826. _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
  3827. _exception ? JNI_ABORT: 0);
  3828. }
  3829. if (_exception) {
  3830. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3831. }
  3832. }
  3833. /* void glGenSamplers ( GLsizei count, GLuint *samplers ) */
  3834. static void
  3835. android_glGenSamplers__ILjava_nio_IntBuffer_2
  3836. (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
  3837. jintArray _array = (jintArray) 0;
  3838. jint _bufferOffset = (jint) 0;
  3839. jint _remaining;
  3840. GLuint *samplers = (GLuint *) 0;
  3841. samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  3842. if (samplers == NULL) {
  3843. char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  3844. samplers = (GLuint *) (_samplersBase + _bufferOffset);
  3845. }
  3846. glGenSamplers(
  3847. (GLsizei)count,
  3848. (GLuint *)samplers
  3849. );
  3850. if (_array) {
  3851. _env->ReleaseIntArrayElements(_array, (jint*)samplers, 0);
  3852. }
  3853. }
  3854. /* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
  3855. static void
  3856. android_glDeleteSamplers__I_3II
  3857. (JNIEnv *_env, jobject _this, jint count, jintArray samplers_ref, jint offset) {
  3858. jint _exception = 0;
  3859. const char * _exceptionType = NULL;
  3860. const char * _exceptionMessage = NULL;
  3861. GLuint *samplers_base = (GLuint *) 0;
  3862. jint _remaining;
  3863. GLuint *samplers = (GLuint *) 0;
  3864. if (!samplers_ref) {
  3865. _exception = 1;
  3866. _exceptionType = "java/lang/IllegalArgumentException";
  3867. _exceptionMessage = "samplers == null";
  3868. goto exit;
  3869. }
  3870. if (offset < 0) {
  3871. _exception = 1;
  3872. _exceptionType = "java/lang/IllegalArgumentException";
  3873. _exceptionMessage = "offset < 0";
  3874. goto exit;
  3875. }
  3876. _remaining = _env->GetArrayLength(samplers_ref) - offset;
  3877. samplers_base = (GLuint *)
  3878. _env->GetIntArrayElements(samplers_ref, (jboolean *)0);
  3879. samplers = samplers_base + offset;
  3880. glDeleteSamplers(
  3881. (GLsizei)count,
  3882. (GLuint *)samplers
  3883. );
  3884. exit:
  3885. if (samplers_base) {
  3886. _env->ReleaseIntArrayElements(samplers_ref, (jint*)samplers_base,
  3887. JNI_ABORT);
  3888. }
  3889. if (_exception) {
  3890. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3891. }
  3892. }
  3893. /* void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) */
  3894. static void
  3895. android_glDeleteSamplers__ILjava_nio_IntBuffer_2
  3896. (JNIEnv *_env, jobject _this, jint count, jobject samplers_buf) {
  3897. jintArray _array = (jintArray) 0;
  3898. jint _bufferOffset = (jint) 0;
  3899. jint _remaining;
  3900. GLuint *samplers = (GLuint *) 0;
  3901. samplers = (GLuint *)getPointer(_env, samplers_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  3902. if (samplers == NULL) {
  3903. char * _samplersBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  3904. samplers = (GLuint *) (_samplersBase + _bufferOffset);
  3905. }
  3906. glDeleteSamplers(
  3907. (GLsizei)count,
  3908. (GLuint *)samplers
  3909. );
  3910. if (_array) {
  3911. _env->ReleaseIntArrayElements(_array, (jint*)samplers, JNI_ABORT);
  3912. }
  3913. }
  3914. /* GLboolean glIsSampler ( GLuint sampler ) */
  3915. static jboolean
  3916. android_glIsSampler__I
  3917. (JNIEnv *_env, jobject _this, jint sampler) {
  3918. GLboolean _returnValue;
  3919. _returnValue = glIsSampler(
  3920. (GLuint)sampler
  3921. );
  3922. return (jboolean)_returnValue;
  3923. }
  3924. /* void glBindSampler ( GLuint unit, GLuint sampler ) */
  3925. static void
  3926. android_glBindSampler__II
  3927. (JNIEnv *_env, jobject _this, jint unit, jint sampler) {
  3928. glBindSampler(
  3929. (GLuint)unit,
  3930. (GLuint)sampler
  3931. );
  3932. }
  3933. /* void glSamplerParameteri ( GLuint sampler, GLenum pname, GLint param ) */
  3934. static void
  3935. android_glSamplerParameteri__III
  3936. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jint param) {
  3937. glSamplerParameteri(
  3938. (GLuint)sampler,
  3939. (GLenum)pname,
  3940. (GLint)param
  3941. );
  3942. }
  3943. /* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
  3944. static void
  3945. android_glSamplerParameteriv__II_3II
  3946. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
  3947. jint _exception = 0;
  3948. const char * _exceptionType = NULL;
  3949. const char * _exceptionMessage = NULL;
  3950. GLint *param_base = (GLint *) 0;
  3951. jint _remaining;
  3952. GLint *param = (GLint *) 0;
  3953. if (!param_ref) {
  3954. _exception = 1;
  3955. _exceptionType = "java/lang/IllegalArgumentException";
  3956. _exceptionMessage = "param == null";
  3957. goto exit;
  3958. }
  3959. if (offset < 0) {
  3960. _exception = 1;
  3961. _exceptionType = "java/lang/IllegalArgumentException";
  3962. _exceptionMessage = "offset < 0";
  3963. goto exit;
  3964. }
  3965. _remaining = _env->GetArrayLength(param_ref) - offset;
  3966. param_base = (GLint *)
  3967. _env->GetIntArrayElements(param_ref, (jboolean *)0);
  3968. param = param_base + offset;
  3969. glSamplerParameteriv(
  3970. (GLuint)sampler,
  3971. (GLenum)pname,
  3972. (GLint *)param
  3973. );
  3974. exit:
  3975. if (param_base) {
  3976. _env->ReleaseIntArrayElements(param_ref, (jint*)param_base,
  3977. JNI_ABORT);
  3978. }
  3979. if (_exception) {
  3980. jniThrowException(_env, _exceptionType, _exceptionMessage);
  3981. }
  3982. }
  3983. /* void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) */
  3984. static void
  3985. android_glSamplerParameteriv__IILjava_nio_IntBuffer_2
  3986. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
  3987. jintArray _array = (jintArray) 0;
  3988. jint _bufferOffset = (jint) 0;
  3989. jint _remaining;
  3990. GLint *param = (GLint *) 0;
  3991. param = (GLint *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  3992. if (param == NULL) {
  3993. char * _paramBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  3994. param = (GLint *) (_paramBase + _bufferOffset);
  3995. }
  3996. glSamplerParameteriv(
  3997. (GLuint)sampler,
  3998. (GLenum)pname,
  3999. (GLint *)param
  4000. );
  4001. if (_array) {
  4002. _env->ReleaseIntArrayElements(_array, (jint*)param, JNI_ABORT);
  4003. }
  4004. }
  4005. /* void glSamplerParameterf ( GLuint sampler, GLenum pname, GLfloat param ) */
  4006. static void
  4007. android_glSamplerParameterf__IIF
  4008. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloat param) {
  4009. glSamplerParameterf(
  4010. (GLuint)sampler,
  4011. (GLenum)pname,
  4012. (GLfloat)param
  4013. );
  4014. }
  4015. /* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
  4016. static void
  4017. android_glSamplerParameterfv__II_3FI
  4018. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray param_ref, jint offset) {
  4019. jint _exception = 0;
  4020. const char * _exceptionType = NULL;
  4021. const char * _exceptionMessage = NULL;
  4022. GLfloat *param_base = (GLfloat *) 0;
  4023. jint _remaining;
  4024. GLfloat *param = (GLfloat *) 0;
  4025. if (!param_ref) {
  4026. _exception = 1;
  4027. _exceptionType = "java/lang/IllegalArgumentException";
  4028. _exceptionMessage = "param == null";
  4029. goto exit;
  4030. }
  4031. if (offset < 0) {
  4032. _exception = 1;
  4033. _exceptionType = "java/lang/IllegalArgumentException";
  4034. _exceptionMessage = "offset < 0";
  4035. goto exit;
  4036. }
  4037. _remaining = _env->GetArrayLength(param_ref) - offset;
  4038. param_base = (GLfloat *)
  4039. _env->GetFloatArrayElements(param_ref, (jboolean *)0);
  4040. param = param_base + offset;
  4041. glSamplerParameterfv(
  4042. (GLuint)sampler,
  4043. (GLenum)pname,
  4044. (GLfloat *)param
  4045. );
  4046. exit:
  4047. if (param_base) {
  4048. _env->ReleaseFloatArrayElements(param_ref, (jfloat*)param_base,
  4049. JNI_ABORT);
  4050. }
  4051. if (_exception) {
  4052. jniThrowException(_env, _exceptionType, _exceptionMessage);
  4053. }
  4054. }
  4055. /* void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) */
  4056. static void
  4057. android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2
  4058. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
  4059. jfloatArray _array = (jfloatArray) 0;
  4060. jint _bufferOffset = (jint) 0;
  4061. jint _remaining;
  4062. GLfloat *param = (GLfloat *) 0;
  4063. param = (GLfloat *)getPointer(_env, param_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  4064. if (param == NULL) {
  4065. char * _paramBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
  4066. param = (GLfloat *) (_paramBase + _bufferOffset);
  4067. }
  4068. glSamplerParameterfv(
  4069. (GLuint)sampler,
  4070. (GLenum)pname,
  4071. (GLfloat *)param
  4072. );
  4073. if (_array) {
  4074. _env->ReleaseFloatArrayElements(_array, (jfloat*)param, JNI_ABORT);
  4075. }
  4076. }
  4077. /* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
  4078. static void
  4079. android_glGetSamplerParameteriv__II_3II
  4080. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
  4081. jint _exception = 0;
  4082. const char * _exceptionType = NULL;
  4083. const char * _exceptionMessage = NULL;
  4084. GLint *params_base = (GLint *) 0;
  4085. jint _remaining;
  4086. GLint *params = (GLint *) 0;
  4087. if (!params_ref) {
  4088. _exception = 1;
  4089. _exceptionType = "java/lang/IllegalArgumentException";
  4090. _exceptionMessage = "params == null";
  4091. goto exit;
  4092. }
  4093. if (offset < 0) {
  4094. _exception = 1;
  4095. _exceptionType = "java/lang/IllegalArgumentException";
  4096. _exceptionMessage = "offset < 0";
  4097. goto exit;
  4098. }
  4099. _remaining = _env->GetArrayLength(params_ref) - offset;
  4100. params_base = (GLint *)
  4101. _env->GetIntArrayElements(params_ref, (jboolean *)0);
  4102. params = params_base + offset;
  4103. glGetSamplerParameteriv(
  4104. (GLuint)sampler,
  4105. (GLenum)pname,
  4106. (GLint *)params
  4107. );
  4108. exit:
  4109. if (params_base) {
  4110. _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
  4111. _exception ? JNI_ABORT: 0);
  4112. }
  4113. if (_exception) {
  4114. jniThrowException(_env, _exceptionType, _exceptionMessage);
  4115. }
  4116. }
  4117. /* void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) */
  4118. static void
  4119. android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2
  4120. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
  4121. jintArray _array = (jintArray) 0;
  4122. jint _bufferOffset = (jint) 0;
  4123. jint _remaining;
  4124. GLint *params = (GLint *) 0;
  4125. params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  4126. if (params == NULL) {
  4127. char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  4128. params = (GLint *) (_paramsBase + _bufferOffset);
  4129. }
  4130. glGetSamplerParameteriv(
  4131. (GLuint)sampler,
  4132. (GLenum)pname,
  4133. (GLint *)params
  4134. );
  4135. if (_array) {
  4136. _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
  4137. }
  4138. }
  4139. /* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
  4140. static void
  4141. android_glGetSamplerParameterfv__II_3FI
  4142. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jfloatArray params_ref, jint offset) {
  4143. jint _exception = 0;
  4144. const char * _exceptionType = NULL;
  4145. const char * _exceptionMessage = NULL;
  4146. GLfloat *params_base = (GLfloat *) 0;
  4147. jint _remaining;
  4148. GLfloat *params = (GLfloat *) 0;
  4149. if (!params_ref) {
  4150. _exception = 1;
  4151. _exceptionType = "java/lang/IllegalArgumentException";
  4152. _exceptionMessage = "params == null";
  4153. goto exit;
  4154. }
  4155. if (offset < 0) {
  4156. _exception = 1;
  4157. _exceptionType = "java/lang/IllegalArgumentException";
  4158. _exceptionMessage = "offset < 0";
  4159. goto exit;
  4160. }
  4161. _remaining = _env->GetArrayLength(params_ref) - offset;
  4162. params_base = (GLfloat *)
  4163. _env->GetFloatArrayElements(params_ref, (jboolean *)0);
  4164. params = params_base + offset;
  4165. glGetSamplerParameterfv(
  4166. (GLuint)sampler,
  4167. (GLenum)pname,
  4168. (GLfloat *)params
  4169. );
  4170. exit:
  4171. if (params_base) {
  4172. _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
  4173. _exception ? JNI_ABORT: 0);
  4174. }
  4175. if (_exception) {
  4176. jniThrowException(_env, _exceptionType, _exceptionMessage);
  4177. }
  4178. }
  4179. /* void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) */
  4180. static void
  4181. android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2
  4182. (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
  4183. jfloatArray _array = (jfloatArray) 0;
  4184. jint _bufferOffset = (jint) 0;
  4185. jint _remaining;
  4186. GLfloat *params = (GLfloat *) 0;
  4187. params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  4188. if (params == NULL) {
  4189. char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
  4190. params = (GLfloat *) (_paramsBase + _bufferOffset);
  4191. }
  4192. glGetSamplerParameterfv(
  4193. (GLuint)sampler,
  4194. (GLenum)pname,
  4195. (GLfloat *)params
  4196. );
  4197. if (_array) {
  4198. _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0);
  4199. }
  4200. }
  4201. /* void glVertexAttribDivisor ( GLuint index, GLuint divisor ) */
  4202. static void
  4203. android_glVertexAttribDivisor__II
  4204. (JNIEnv *_env, jobject _this, jint index, jint divisor) {
  4205. glVertexAttribDivisor(
  4206. (GLuint)index,
  4207. (GLuint)divisor
  4208. );
  4209. }
  4210. /* void glBindTransformFeedback ( GLenum target, GLuint id ) */
  4211. static void
  4212. android_glBindTransformFeedback__II
  4213. (JNIEnv *_env, jobject _this, jint target, jint id) {
  4214. glBindTransformFeedback(
  4215. (GLenum)target,
  4216. (GLuint)id
  4217. );
  4218. }
  4219. /* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
  4220. static void
  4221. android_glDeleteTransformFeedbacks__I_3II
  4222. (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
  4223. jint _exception = 0;
  4224. const char * _exceptionType = NULL;
  4225. const char * _exceptionMessage = NULL;
  4226. GLuint *ids_base = (GLuint *) 0;
  4227. jint _remaining;
  4228. GLuint *ids = (GLuint *) 0;
  4229. if (!ids_ref) {
  4230. _exception = 1;
  4231. _exceptionType = "java/lang/IllegalArgumentException";
  4232. _exceptionMessage = "ids == null";
  4233. goto exit;
  4234. }
  4235. if (offset < 0) {
  4236. _exception = 1;
  4237. _exceptionType = "java/lang/IllegalArgumentException";
  4238. _exceptionMessage = "offset < 0";
  4239. goto exit;
  4240. }
  4241. _remaining = _env->GetArrayLength(ids_ref) - offset;
  4242. ids_base = (GLuint *)
  4243. _env->GetIntArrayElements(ids_ref, (jboolean *)0);
  4244. ids = ids_base + offset;
  4245. glDeleteTransformFeedbacks(
  4246. (GLsizei)n,
  4247. (GLuint *)ids
  4248. );
  4249. exit:
  4250. if (ids_base) {
  4251. _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
  4252. JNI_ABORT);
  4253. }
  4254. if (_exception) {
  4255. jniThrowException(_env, _exceptionType, _exceptionMessage);
  4256. }
  4257. }
  4258. /* void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) */
  4259. static void
  4260. android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2
  4261. (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
  4262. jintArray _array = (jintArray) 0;
  4263. jint _bufferOffset = (jint) 0;
  4264. jint _remaining;
  4265. GLuint *ids = (GLuint *) 0;
  4266. ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  4267. if (ids == NULL) {
  4268. char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  4269. ids = (GLuint *) (_idsBase + _bufferOffset);
  4270. }
  4271. glDeleteTransformFeedbacks(
  4272. (GLsizei)n,
  4273. (GLuint *)ids
  4274. );
  4275. if (_array) {
  4276. _env->ReleaseIntArrayElements(_array, (jint*)ids, JNI_ABORT);
  4277. }
  4278. }
  4279. /* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
  4280. static void
  4281. android_glGenTransformFeedbacks__I_3II
  4282. (JNIEnv *_env, jobject _this, jint n, jintArray ids_ref, jint offset) {
  4283. jint _exception = 0;
  4284. const char * _exceptionType = NULL;
  4285. const char * _exceptionMessage = NULL;
  4286. GLuint *ids_base = (GLuint *) 0;
  4287. jint _remaining;
  4288. GLuint *ids = (GLuint *) 0;
  4289. if (!ids_ref) {
  4290. _exception = 1;
  4291. _exceptionType = "java/lang/IllegalArgumentException";
  4292. _exceptionMessage = "ids == null";
  4293. goto exit;
  4294. }
  4295. if (offset < 0) {
  4296. _exception = 1;
  4297. _exceptionType = "java/lang/IllegalArgumentException";
  4298. _exceptionMessage = "offset < 0";
  4299. goto exit;
  4300. }
  4301. _remaining = _env->GetArrayLength(ids_ref) - offset;
  4302. ids_base = (GLuint *)
  4303. _env->GetIntArrayElements(ids_ref, (jboolean *)0);
  4304. ids = ids_base + offset;
  4305. glGenTransformFeedbacks(
  4306. (GLsizei)n,
  4307. (GLuint *)ids
  4308. );
  4309. exit:
  4310. if (ids_base) {
  4311. _env->ReleaseIntArrayElements(ids_ref, (jint*)ids_base,
  4312. _exception ? JNI_ABORT: 0);
  4313. }
  4314. if (_exception) {
  4315. jniThrowException(_env, _exceptionType, _exceptionMessage);
  4316. }
  4317. }
  4318. /* void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) */
  4319. static void
  4320. android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2
  4321. (JNIEnv *_env, jobject _this, jint n, jobject ids_buf) {
  4322. jintArray _array = (jintArray) 0;
  4323. jint _bufferOffset = (jint) 0;
  4324. jint _remaining;
  4325. GLuint *ids = (GLuint *) 0;
  4326. ids = (GLuint *)getPointer(_env, ids_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  4327. if (ids == NULL) {
  4328. char * _idsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  4329. ids = (GLuint *) (_idsBase + _bufferOffset);
  4330. }
  4331. glGenTransformFeedbacks(
  4332. (GLsizei)n,
  4333. (GLuint *)ids
  4334. );
  4335. if (_array) {
  4336. _env->ReleaseIntArrayElements(_array, (jint*)ids, 0);
  4337. }
  4338. }
  4339. /* GLboolean glIsTransformFeedback ( GLuint id ) */
  4340. static jboolean
  4341. android_glIsTransformFeedback__I
  4342. (JNIEnv *_env, jobject _this, jint id) {
  4343. GLboolean _returnValue;
  4344. _returnValue = glIsTransformFeedback(
  4345. (GLuint)id
  4346. );
  4347. return (jboolean)_returnValue;
  4348. }
  4349. /* void glPauseTransformFeedback ( void ) */
  4350. static void
  4351. android_glPauseTransformFeedback__
  4352. (JNIEnv *_env, jobject _this) {
  4353. glPauseTransformFeedback();
  4354. }
  4355. /* void glResumeTransformFeedback ( void ) */
  4356. static void
  4357. android_glResumeTransformFeedback__
  4358. (JNIEnv *_env, jobject _this) {
  4359. glResumeTransformFeedback();
  4360. }
  4361. /* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
  4362. static void
  4363. android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2
  4364. (JNIEnv *_env, jobject _this, jint program, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray binaryFormat_ref, jint binaryFormatOffset, jobject binary_buf) {
  4365. jint _exception = 0;
  4366. const char * _exceptionType = NULL;
  4367. const char * _exceptionMessage = NULL;
  4368. jarray _array = (jarray) 0;
  4369. jint _bufferOffset = (jint) 0;
  4370. GLsizei *length_base = (GLsizei *) 0;
  4371. jint _lengthRemaining;
  4372. GLsizei *length = (GLsizei *) 0;
  4373. GLenum *binaryFormat_base = (GLenum *) 0;
  4374. jint _binaryFormatRemaining;
  4375. GLenum *binaryFormat = (GLenum *) 0;
  4376. jint _binaryRemaining;
  4377. GLvoid *binary = (GLvoid *) 0;
  4378. if (length_ref) {
  4379. if (lengthOffset < 0) {
  4380. _exception = 1;
  4381. _exceptionType = "java/lang/IllegalArgumentException";
  4382. _exceptionMessage = "lengthOffset < 0";
  4383. goto exit;
  4384. }
  4385. _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
  4386. length_base = (GLsizei *)
  4387. _env->GetIntArrayElements(length_ref, (jboolean *)0);
  4388. length = length_base + lengthOffset;
  4389. }
  4390. if (!binaryFormat_ref) {
  4391. _exception = 1;
  4392. _exceptionType = "java/lang/IllegalArgumentException";
  4393. _exceptionMessage = "binaryFormat == null";
  4394. goto exit;
  4395. }
  4396. if (binaryFormatOffset < 0) {
  4397. _exception = 1;
  4398. _exceptionType = "java/lang/IllegalArgumentException";
  4399. _exceptionMessage = "binaryFormatOffset < 0";
  4400. goto exit;
  4401. }
  4402. _binaryFormatRemaining = _env->GetArrayLength(binaryFormat_ref) - binaryFormatOffset;
  4403. binaryFormat_base = (GLenum *)
  4404. _env->GetIntArrayElements(binaryFormat_ref, (jboolean *)0);
  4405. binaryFormat = binaryFormat_base + binaryFormatOffset;
  4406. binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_binaryRemaining, &_bufferOffset);
  4407. if (binary == NULL) {
  4408. char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
  4409. binary = (GLvoid *) (_binaryBase + _bufferOffset);
  4410. }
  4411. glGetProgramBinary(
  4412. (GLuint)program,
  4413. (GLsizei)bufSize,
  4414. (GLsizei *)length,
  4415. (GLenum *)binaryFormat,
  4416. (GLvoid *)binary
  4417. );
  4418. exit:
  4419. if (_array) {
  4420. releasePointer(_env, _array, binary, _exception ? JNI_FALSE : JNI_TRUE);
  4421. }
  4422. if (binaryFormat_base) {
  4423. _env->ReleaseIntArrayElements(binaryFormat_ref, (jint*)binaryFormat_base,
  4424. _exception ? JNI_ABORT: 0);
  4425. }
  4426. if (length_base) {
  4427. _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
  4428. _exception ? JNI_ABORT: 0);
  4429. }
  4430. if (_exception) {
  4431. jniThrowException(_env, _exceptionType, _exceptionMessage);
  4432. }
  4433. }
  4434. /* void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) */
  4435. static void
  4436. android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2
  4437. (JNIEnv *_env, jobject _this, jint program, jint bufSize, jobject length_buf, jobject binaryFormat_buf, jobject binary_buf) {
  4438. jintArray _lengthArray = (jintArray) 0;
  4439. jint _lengthBufferOffset = (jint) 0;
  4440. jintArray _binaryFormatArray = (jintArray) 0;
  4441. jint _binaryFormatBufferOffset = (jint) 0;
  4442. jintArray _binaryArray = (jintArray) 0;
  4443. jint _binaryBufferOffset = (jint) 0;
  4444. jint _lengthRemaining;
  4445. GLsizei *length = (GLsizei *) 0;
  4446. jint _binaryFormatRemaining;
  4447. GLenum *binaryFormat = (GLenum *) 0;
  4448. jint _binaryRemaining;
  4449. GLvoid *binary = (GLvoid *) 0;
  4450. if (length_buf) {
  4451. length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
  4452. }
  4453. binaryFormat = (GLenum *)getPointer(_env, binaryFormat_buf, (jarray*)&_binaryFormatArray, &_binaryFormatRemaining, &_binaryFormatBufferOffset);
  4454. binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_binaryArray, &_binaryRemaining, &_binaryBufferOffset);
  4455. if (length_buf && length == NULL) {
  4456. char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
  4457. length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
  4458. }
  4459. if (binaryFormat == NULL) {
  4460. char * _binaryFormatBase = (char *)_env->GetIntArrayElements(_binaryFormatArray, (jboolean *) 0);
  4461. binaryFormat = (GLenum *) (_binaryFormatBase + _binaryFormatBufferOffset);
  4462. }
  4463. if (binary == NULL) {
  4464. char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_binaryArray, (jboolean *) 0);
  4465. binary = (GLvoid *) (_binaryBase + _binaryBufferOffset);
  4466. }
  4467. glGetProgramBinary(
  4468. (GLuint)program,
  4469. (GLsizei)bufSize,
  4470. (GLsizei *)length,
  4471. (GLenum *)binaryFormat,
  4472. (GLvoid *)binary
  4473. );
  4474. if (_binaryArray) {
  4475. releasePointer(_env, _binaryArray, binary, JNI_TRUE);
  4476. }
  4477. if (_binaryFormatArray) {
  4478. _env->ReleaseIntArrayElements(_binaryFormatArray, (jint*)binaryFormat, 0);
  4479. }
  4480. if (_lengthArray) {
  4481. _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, 0);
  4482. }
  4483. }
  4484. /* void glProgramBinary ( GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length ) */
  4485. static void
  4486. android_glProgramBinary__IILjava_nio_Buffer_2I
  4487. (JNIEnv *_env, jobject _this, jint program, jint binaryFormat, jobject binary_buf, jint length) {
  4488. jarray _array = (jarray) 0;
  4489. jint _bufferOffset = (jint) 0;
  4490. jint _remaining;
  4491. GLvoid *binary = (GLvoid *) 0;
  4492. binary = (GLvoid *)getPointer(_env, binary_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  4493. if (binary == NULL) {
  4494. char * _binaryBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
  4495. binary = (GLvoid *) (_binaryBase + _bufferOffset);
  4496. }
  4497. glProgramBinary(
  4498. (GLuint)program,
  4499. (GLenum)binaryFormat,
  4500. (GLvoid *)binary,
  4501. (GLsizei)length
  4502. );
  4503. if (_array) {
  4504. releasePointer(_env, _array, binary, JNI_FALSE);
  4505. }
  4506. }
  4507. /* void glProgramParameteri ( GLuint program, GLenum pname, GLint value ) */
  4508. static void
  4509. android_glProgramParameteri__III
  4510. (JNIEnv *_env, jobject _this, jint program, jint pname, jint value) {
  4511. glProgramParameteri(
  4512. (GLuint)program,
  4513. (GLenum)pname,
  4514. (GLint)value
  4515. );
  4516. }
  4517. /* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
  4518. static void
  4519. android_glInvalidateFramebuffer__II_3II
  4520. (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset) {
  4521. jint _exception = 0;
  4522. const char * _exceptionType = NULL;
  4523. const char * _exceptionMessage = NULL;
  4524. GLenum *attachments_base = (GLenum *) 0;
  4525. jint _remaining;
  4526. GLenum *attachments = (GLenum *) 0;
  4527. if (!attachments_ref) {
  4528. _exception = 1;
  4529. _exceptionType = "java/lang/IllegalArgumentException";
  4530. _exceptionMessage = "attachments == null";
  4531. goto exit;
  4532. }
  4533. if (offset < 0) {
  4534. _exception = 1;
  4535. _exceptionType = "java/lang/IllegalArgumentException";
  4536. _exceptionMessage = "offset < 0";
  4537. goto exit;
  4538. }
  4539. _remaining = _env->GetArrayLength(attachments_ref) - offset;
  4540. attachments_base = (GLenum *)
  4541. _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
  4542. attachments = attachments_base + offset;
  4543. glInvalidateFramebuffer(
  4544. (GLenum)target,
  4545. (GLsizei)numAttachments,
  4546. (GLenum *)attachments
  4547. );
  4548. exit:
  4549. if (attachments_base) {
  4550. _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
  4551. JNI_ABORT);
  4552. }
  4553. if (_exception) {
  4554. jniThrowException(_env, _exceptionType, _exceptionMessage);
  4555. }
  4556. }
  4557. /* void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) */
  4558. static void
  4559. android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2
  4560. (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf) {
  4561. jintArray _array = (jintArray) 0;
  4562. jint _bufferOffset = (jint) 0;
  4563. jint _remaining;
  4564. GLenum *attachments = (GLenum *) 0;
  4565. attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  4566. if (attachments == NULL) {
  4567. char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  4568. attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
  4569. }
  4570. glInvalidateFramebuffer(
  4571. (GLenum)target,
  4572. (GLsizei)numAttachments,
  4573. (GLenum *)attachments
  4574. );
  4575. if (_array) {
  4576. _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
  4577. }
  4578. }
  4579. /* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
  4580. static void
  4581. android_glInvalidateSubFramebuffer__II_3IIIIII
  4582. (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jintArray attachments_ref, jint offset, jint x, jint y, jint width, jint height) {
  4583. jint _exception = 0;
  4584. const char * _exceptionType = NULL;
  4585. const char * _exceptionMessage = NULL;
  4586. GLenum *attachments_base = (GLenum *) 0;
  4587. jint _remaining;
  4588. GLenum *attachments = (GLenum *) 0;
  4589. if (!attachments_ref) {
  4590. _exception = 1;
  4591. _exceptionType = "java/lang/IllegalArgumentException";
  4592. _exceptionMessage = "attachments == null";
  4593. goto exit;
  4594. }
  4595. if (offset < 0) {
  4596. _exception = 1;
  4597. _exceptionType = "java/lang/IllegalArgumentException";
  4598. _exceptionMessage = "offset < 0";
  4599. goto exit;
  4600. }
  4601. _remaining = _env->GetArrayLength(attachments_ref) - offset;
  4602. attachments_base = (GLenum *)
  4603. _env->GetIntArrayElements(attachments_ref, (jboolean *)0);
  4604. attachments = attachments_base + offset;
  4605. glInvalidateSubFramebuffer(
  4606. (GLenum)target,
  4607. (GLsizei)numAttachments,
  4608. (GLenum *)attachments,
  4609. (GLint)x,
  4610. (GLint)y,
  4611. (GLsizei)width,
  4612. (GLsizei)height
  4613. );
  4614. exit:
  4615. if (attachments_base) {
  4616. _env->ReleaseIntArrayElements(attachments_ref, (jint*)attachments_base,
  4617. JNI_ABORT);
  4618. }
  4619. if (_exception) {
  4620. jniThrowException(_env, _exceptionType, _exceptionMessage);
  4621. }
  4622. }
  4623. /* void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) */
  4624. static void
  4625. android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII
  4626. (JNIEnv *_env, jobject _this, jint target, jint numAttachments, jobject attachments_buf, jint x, jint y, jint width, jint height) {
  4627. jintArray _array = (jintArray) 0;
  4628. jint _bufferOffset = (jint) 0;
  4629. jint _remaining;
  4630. GLenum *attachments = (GLenum *) 0;
  4631. attachments = (GLenum *)getPointer(_env, attachments_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  4632. if (attachments == NULL) {
  4633. char * _attachmentsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  4634. attachments = (GLenum *) (_attachmentsBase + _bufferOffset);
  4635. }
  4636. glInvalidateSubFramebuffer(
  4637. (GLenum)target,
  4638. (GLsizei)numAttachments,
  4639. (GLenum *)attachments,
  4640. (GLint)x,
  4641. (GLint)y,
  4642. (GLsizei)width,
  4643. (GLsizei)height
  4644. );
  4645. if (_array) {
  4646. _env->ReleaseIntArrayElements(_array, (jint*)attachments, JNI_ABORT);
  4647. }
  4648. }
  4649. /* void glTexStorage2D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) */
  4650. static void
  4651. android_glTexStorage2D__IIIII
  4652. (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height) {
  4653. glTexStorage2D(
  4654. (GLenum)target,
  4655. (GLsizei)levels,
  4656. (GLenum)internalformat,
  4657. (GLsizei)width,
  4658. (GLsizei)height
  4659. );
  4660. }
  4661. /* void glTexStorage3D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) */
  4662. static void
  4663. android_glTexStorage3D__IIIIII
  4664. (JNIEnv *_env, jobject _this, jint target, jint levels, jint internalformat, jint width, jint height, jint depth) {
  4665. glTexStorage3D(
  4666. (GLenum)target,
  4667. (GLsizei)levels,
  4668. (GLenum)internalformat,
  4669. (GLsizei)width,
  4670. (GLsizei)height,
  4671. (GLsizei)depth
  4672. );
  4673. }
  4674. /* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
  4675. static void
  4676. android_glGetInternalformativ__IIII_3II
  4677. (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jintArray params_ref, jint offset) {
  4678. jint _exception = 0;
  4679. const char * _exceptionType = NULL;
  4680. const char * _exceptionMessage = NULL;
  4681. GLint *params_base = (GLint *) 0;
  4682. jint _remaining;
  4683. GLint *params = (GLint *) 0;
  4684. if (!params_ref) {
  4685. _exception = 1;
  4686. _exceptionType = "java/lang/IllegalArgumentException";
  4687. _exceptionMessage = "params == null";
  4688. goto exit;
  4689. }
  4690. if (offset < 0) {
  4691. _exception = 1;
  4692. _exceptionType = "java/lang/IllegalArgumentException";
  4693. _exceptionMessage = "offset < 0";
  4694. goto exit;
  4695. }
  4696. _remaining = _env->GetArrayLength(params_ref) - offset;
  4697. params_base = (GLint *)
  4698. _env->GetIntArrayElements(params_ref, (jboolean *)0);
  4699. params = params_base + offset;
  4700. glGetInternalformativ(
  4701. (GLenum)target,
  4702. (GLenum)internalformat,
  4703. (GLenum)pname,
  4704. (GLsizei)bufSize,
  4705. (GLint *)params
  4706. );
  4707. exit:
  4708. if (params_base) {
  4709. _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
  4710. _exception ? JNI_ABORT: 0);
  4711. }
  4712. if (_exception) {
  4713. jniThrowException(_env, _exceptionType, _exceptionMessage);
  4714. }
  4715. }
  4716. /* void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) */
  4717. static void
  4718. android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2
  4719. (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint pname, jint bufSize, jobject params_buf) {
  4720. jintArray _array = (jintArray) 0;
  4721. jint _bufferOffset = (jint) 0;
  4722. jint _remaining;
  4723. GLint *params = (GLint *) 0;
  4724. params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
  4725. if (params == NULL) {
  4726. char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
  4727. params = (GLint *) (_paramsBase + _bufferOffset);
  4728. }
  4729. glGetInternalformativ(
  4730. (GLenum)target,
  4731. (GLenum)internalformat,
  4732. (GLenum)pname,
  4733. (GLsizei)bufSize,
  4734. (GLint *)params
  4735. );
  4736. if (_array) {
  4737. _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
  4738. }
  4739. }
  4740. /* void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint offset ) */
  4741. static void
  4742. android_glReadPixels__IIIIIII
  4743. (JNIEnv *_env, jobject _this, jint x, jint y, jint width, jint height, jint format, jint type, jint offset) {
  4744. glReadPixels(
  4745. (GLint)x,
  4746. (GLint)y,
  4747. (GLsizei)width,
  4748. (GLsizei)height,
  4749. (GLenum)format,
  4750. (GLenum)type,
  4751. reinterpret_cast<GLvoid *>(offset)
  4752. );
  4753. }
  4754. static const char *classPathName = "android/opengl/GLES30";
  4755. static const JNINativeMethod methods[] = {
  4756. {"_nativeClassInit", "()V", (void*)nativeClassInit },
  4757. {"glReadBuffer", "(I)V", (void *) android_glReadBuffer__I },
  4758. {"glDrawRangeElements", "(IIIIILjava/nio/Buffer;)V", (void *) android_glDrawRangeElements__IIIIILjava_nio_Buffer_2 },
  4759. {"glDrawRangeElements", "(IIIIII)V", (void *) android_glDrawRangeElements__IIIIII },
  4760. {"glTexImage3D", "(IIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexImage3D__IIIIIIIIILjava_nio_Buffer_2 },
  4761. {"glTexImage3D", "(IIIIIIIIII)V", (void *) android_glTexImage3D__IIIIIIIIII },
  4762. {"glTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
  4763. {"glTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glTexSubImage3D__IIIIIIIIIII },
  4764. {"glCopyTexSubImage3D", "(IIIIIIIII)V", (void *) android_glCopyTexSubImage3D__IIIIIIIII },
  4765. {"glCompressedTexImage3D", "(IIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexImage3D__IIIIIIIILjava_nio_Buffer_2 },
  4766. {"glCompressedTexImage3D", "(IIIIIIIII)V", (void *) android_glCompressedTexImage3D__IIIIIIIII },
  4767. {"glCompressedTexSubImage3D", "(IIIIIIIIIILjava/nio/Buffer;)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIILjava_nio_Buffer_2 },
  4768. {"glCompressedTexSubImage3D", "(IIIIIIIIIII)V", (void *) android_glCompressedTexSubImage3D__IIIIIIIIIII },
  4769. {"glGenQueries", "(I[II)V", (void *) android_glGenQueries__I_3II },
  4770. {"glGenQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenQueries__ILjava_nio_IntBuffer_2 },
  4771. {"glDeleteQueries", "(I[II)V", (void *) android_glDeleteQueries__I_3II },
  4772. {"glDeleteQueries", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteQueries__ILjava_nio_IntBuffer_2 },
  4773. {"glIsQuery", "(I)Z", (void *) android_glIsQuery__I },
  4774. {"glBeginQuery", "(II)V", (void *) android_glBeginQuery__II },
  4775. {"glEndQuery", "(I)V", (void *) android_glEndQuery__I },
  4776. {"glGetQueryiv", "(II[II)V", (void *) android_glGetQueryiv__II_3II },
  4777. {"glGetQueryiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryiv__IILjava_nio_IntBuffer_2 },
  4778. {"glGetQueryObjectuiv", "(II[II)V", (void *) android_glGetQueryObjectuiv__II_3II },
  4779. {"glGetQueryObjectuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetQueryObjectuiv__IILjava_nio_IntBuffer_2 },
  4780. {"glUnmapBuffer", "(I)Z", (void *) android_glUnmapBuffer__I },
  4781. {"glGetBufferPointerv", "(II)Ljava/nio/Buffer;", (void *) android_glGetBufferPointerv__II },
  4782. {"glDrawBuffers", "(I[II)V", (void *) android_glDrawBuffers__I_3II },
  4783. {"glDrawBuffers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDrawBuffers__ILjava_nio_IntBuffer_2 },
  4784. {"glUniformMatrix2x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x3fv__IIZ_3FI },
  4785. {"glUniformMatrix2x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x3fv__IIZLjava_nio_FloatBuffer_2 },
  4786. {"glUniformMatrix3x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x2fv__IIZ_3FI },
  4787. {"glUniformMatrix3x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x2fv__IIZLjava_nio_FloatBuffer_2 },
  4788. {"glUniformMatrix2x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix2x4fv__IIZ_3FI },
  4789. {"glUniformMatrix2x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix2x4fv__IIZLjava_nio_FloatBuffer_2 },
  4790. {"glUniformMatrix4x2fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x2fv__IIZ_3FI },
  4791. {"glUniformMatrix4x2fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x2fv__IIZLjava_nio_FloatBuffer_2 },
  4792. {"glUniformMatrix3x4fv", "(IIZ[FI)V", (void *) android_glUniformMatrix3x4fv__IIZ_3FI },
  4793. {"glUniformMatrix3x4fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix3x4fv__IIZLjava_nio_FloatBuffer_2 },
  4794. {"glUniformMatrix4x3fv", "(IIZ[FI)V", (void *) android_glUniformMatrix4x3fv__IIZ_3FI },
  4795. {"glUniformMatrix4x3fv", "(IIZLjava/nio/FloatBuffer;)V", (void *) android_glUniformMatrix4x3fv__IIZLjava_nio_FloatBuffer_2 },
  4796. {"glBlitFramebuffer", "(IIIIIIIIII)V", (void *) android_glBlitFramebuffer__IIIIIIIIII },
  4797. {"glRenderbufferStorageMultisample", "(IIIII)V", (void *) android_glRenderbufferStorageMultisample__IIIII },
  4798. {"glFramebufferTextureLayer", "(IIIII)V", (void *) android_glFramebufferTextureLayer__IIIII },
  4799. {"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII },
  4800. {"glFlushMappedBufferRange", "(III)V", (void *) android_glFlushMappedBufferRange__III },
  4801. {"glBindVertexArray", "(I)V", (void *) android_glBindVertexArray__I },
  4802. {"glDeleteVertexArrays", "(I[II)V", (void *) android_glDeleteVertexArrays__I_3II },
  4803. {"glDeleteVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteVertexArrays__ILjava_nio_IntBuffer_2 },
  4804. {"glGenVertexArrays", "(I[II)V", (void *) android_glGenVertexArrays__I_3II },
  4805. {"glGenVertexArrays", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenVertexArrays__ILjava_nio_IntBuffer_2 },
  4806. {"glIsVertexArray", "(I)Z", (void *) android_glIsVertexArray__I },
  4807. {"glGetIntegeri_v", "(II[II)V", (void *) android_glGetIntegeri_v__II_3II },
  4808. {"glGetIntegeri_v", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetIntegeri_v__IILjava_nio_IntBuffer_2 },
  4809. {"glBeginTransformFeedback", "(I)V", (void *) android_glBeginTransformFeedback__I },
  4810. {"glEndTransformFeedback", "()V", (void *) android_glEndTransformFeedback__ },
  4811. {"glBindBufferRange", "(IIIII)V", (void *) android_glBindBufferRange__IIIII },
  4812. {"glBindBufferBase", "(III)V", (void *) android_glBindBufferBase__III },
  4813. {"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings },
  4814. {"glGetTransformFeedbackVarying", "(III[II[II[II[BI)V", (void *) android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI },
  4815. {"glGetTransformFeedbackVarying", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B },
  4816. {"glGetTransformFeedbackVarying", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/ByteBuffer;)V", (void *) android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2 },
  4817. {"glGetTransformFeedbackVarying", "(II[II[II)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying1 },
  4818. {"glGetTransformFeedbackVarying", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying2 },
  4819. {"glVertexAttribIPointerBounds", "(IIIILjava/nio/Buffer;I)V", (void *) android_glVertexAttribIPointerBounds__IIIILjava_nio_Buffer_2I },
  4820. {"glVertexAttribIPointer", "(IIIII)V", (void *) android_glVertexAttribIPointer__IIIII },
  4821. {"glGetVertexAttribIiv", "(II[II)V", (void *) android_glGetVertexAttribIiv__II_3II },
  4822. {"glGetVertexAttribIiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIiv__IILjava_nio_IntBuffer_2 },
  4823. {"glGetVertexAttribIuiv", "(II[II)V", (void *) android_glGetVertexAttribIuiv__II_3II },
  4824. {"glGetVertexAttribIuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetVertexAttribIuiv__IILjava_nio_IntBuffer_2 },
  4825. {"glVertexAttribI4i", "(IIIII)V", (void *) android_glVertexAttribI4i__IIIII },
  4826. {"glVertexAttribI4ui", "(IIIII)V", (void *) android_glVertexAttribI4ui__IIIII },
  4827. {"glVertexAttribI4iv", "(I[II)V", (void *) android_glVertexAttribI4iv__I_3II },
  4828. {"glVertexAttribI4iv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4iv__ILjava_nio_IntBuffer_2 },
  4829. {"glVertexAttribI4uiv", "(I[II)V", (void *) android_glVertexAttribI4uiv__I_3II },
  4830. {"glVertexAttribI4uiv", "(ILjava/nio/IntBuffer;)V", (void *) android_glVertexAttribI4uiv__ILjava_nio_IntBuffer_2 },
  4831. {"glGetUniformuiv", "(II[II)V", (void *) android_glGetUniformuiv__II_3II },
  4832. {"glGetUniformuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetUniformuiv__IILjava_nio_IntBuffer_2 },
  4833. {"glGetFragDataLocation", "(ILjava/lang/String;)I", (void *) android_glGetFragDataLocation__ILjava_lang_String_2 },
  4834. {"glUniform1ui", "(II)V", (void *) android_glUniform1ui__II },
  4835. {"glUniform2ui", "(III)V", (void *) android_glUniform2ui__III },
  4836. {"glUniform3ui", "(IIII)V", (void *) android_glUniform3ui__IIII },
  4837. {"glUniform4ui", "(IIIII)V", (void *) android_glUniform4ui__IIIII },
  4838. {"glUniform1uiv", "(II[II)V", (void *) android_glUniform1uiv__II_3II },
  4839. {"glUniform1uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform1uiv__IILjava_nio_IntBuffer_2 },
  4840. {"glUniform2uiv", "(II[II)V", (void *) android_glUniform2uiv__II_3II },
  4841. {"glUniform2uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform2uiv__IILjava_nio_IntBuffer_2 },
  4842. {"glUniform3uiv", "(II[II)V", (void *) android_glUniform3uiv__II_3II },
  4843. {"glUniform3uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform3uiv__IILjava_nio_IntBuffer_2 },
  4844. {"glUniform4uiv", "(II[II)V", (void *) android_glUniform4uiv__II_3II },
  4845. {"glUniform4uiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glUniform4uiv__IILjava_nio_IntBuffer_2 },
  4846. {"glClearBufferiv", "(II[II)V", (void *) android_glClearBufferiv__II_3II },
  4847. {"glClearBufferiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferiv__IILjava_nio_IntBuffer_2 },
  4848. {"glClearBufferuiv", "(II[II)V", (void *) android_glClearBufferuiv__II_3II },
  4849. {"glClearBufferuiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glClearBufferuiv__IILjava_nio_IntBuffer_2 },
  4850. {"glClearBufferfv", "(II[FI)V", (void *) android_glClearBufferfv__II_3FI },
  4851. {"glClearBufferfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glClearBufferfv__IILjava_nio_FloatBuffer_2 },
  4852. {"glClearBufferfi", "(IIFI)V", (void *) android_glClearBufferfi__IIFI },
  4853. {"glGetStringi", "(II)Ljava/lang/String;", (void *) android_glGetStringi__II },
  4854. {"glCopyBufferSubData", "(IIIII)V", (void *) android_glCopyBufferSubData__IIIII },
  4855. {"glGetUniformIndices", "(I[Ljava/lang/String;[II)V", (void *) android_glGetUniformIndices_array },
  4856. {"glGetUniformIndices", "(I[Ljava/lang/String;Ljava/nio/IntBuffer;)V", (void *) android_glGetUniformIndices_buffer },
  4857. {"glGetActiveUniformsiv", "(II[III[II)V", (void *) android_glGetActiveUniformsiv__II_3III_3II },
  4858. {"glGetActiveUniformsiv", "(IILjava/nio/IntBuffer;ILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformsiv__IILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2 },
  4859. {"glGetUniformBlockIndex", "(ILjava/lang/String;)I", (void *) android_glGetUniformBlockIndex__ILjava_lang_String_2 },
  4860. {"glGetActiveUniformBlockiv", "(III[II)V", (void *) android_glGetActiveUniformBlockiv__III_3II },
  4861. {"glGetActiveUniformBlockiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetActiveUniformBlockiv__IIILjava_nio_IntBuffer_2 },
  4862. {"glGetActiveUniformBlockName", "(III[II[BI)V", (void *) android_glGetActiveUniformBlockName_III_3II_3BI },
  4863. {"glGetActiveUniformBlockName", "(IILjava/nio/Buffer;Ljava/nio/Buffer;)V", (void *) android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 },
  4864. {"glGetActiveUniformBlockName", "(II)Ljava/lang/String;", (void *) android_glGetActiveUniformBlockName_II },
  4865. {"glUniformBlockBinding", "(III)V", (void *) android_glUniformBlockBinding__III },
  4866. {"glDrawArraysInstanced", "(IIII)V", (void *) android_glDrawArraysInstanced__IIII },
  4867. {"glDrawElementsInstanced", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I },
  4868. {"glDrawElementsInstanced", "(IIIII)V", (void *) android_glDrawElementsInstanced__IIIII },
  4869. {"glFenceSync", "(II)J", (void *) android_glFenceSync__II },
  4870. {"glIsSync", "(J)Z", (void *) android_glIsSync__J },
  4871. {"glDeleteSync", "(J)V", (void *) android_glDeleteSync__J },
  4872. {"glClientWaitSync", "(JIJ)I", (void *) android_glClientWaitSync__JIJ },
  4873. {"glWaitSync", "(JIJ)V", (void *) android_glWaitSync__JIJ },
  4874. {"glGetInteger64v", "(I[JI)V", (void *) android_glGetInteger64v__I_3JI },
  4875. {"glGetInteger64v", "(ILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64v__ILjava_nio_LongBuffer_2 },
  4876. {"glGetSynciv", "(JII[II[II)V", (void *) android_glGetSynciv__JII_3II_3II },
  4877. {"glGetSynciv", "(JIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetSynciv__JIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
  4878. {"glGetInteger64i_v", "(II[JI)V", (void *) android_glGetInteger64i_v__II_3JI },
  4879. {"glGetInteger64i_v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetInteger64i_v__IILjava_nio_LongBuffer_2 },
  4880. {"glGetBufferParameteri64v", "(II[JI)V", (void *) android_glGetBufferParameteri64v__II_3JI },
  4881. {"glGetBufferParameteri64v", "(IILjava/nio/LongBuffer;)V", (void *) android_glGetBufferParameteri64v__IILjava_nio_LongBuffer_2 },
  4882. {"glGenSamplers", "(I[II)V", (void *) android_glGenSamplers__I_3II },
  4883. {"glGenSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenSamplers__ILjava_nio_IntBuffer_2 },
  4884. {"glDeleteSamplers", "(I[II)V", (void *) android_glDeleteSamplers__I_3II },
  4885. {"glDeleteSamplers", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteSamplers__ILjava_nio_IntBuffer_2 },
  4886. {"glIsSampler", "(I)Z", (void *) android_glIsSampler__I },
  4887. {"glBindSampler", "(II)V", (void *) android_glBindSampler__II },
  4888. {"glSamplerParameteri", "(III)V", (void *) android_glSamplerParameteri__III },
  4889. {"glSamplerParameteriv", "(II[II)V", (void *) android_glSamplerParameteriv__II_3II },
  4890. {"glSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameteriv__IILjava_nio_IntBuffer_2 },
  4891. {"glSamplerParameterf", "(IIF)V", (void *) android_glSamplerParameterf__IIF },
  4892. {"glSamplerParameterfv", "(II[FI)V", (void *) android_glSamplerParameterfv__II_3FI },
  4893. {"glSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
  4894. {"glGetSamplerParameteriv", "(II[II)V", (void *) android_glGetSamplerParameteriv__II_3II },
  4895. {"glGetSamplerParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameteriv__IILjava_nio_IntBuffer_2 },
  4896. {"glGetSamplerParameterfv", "(II[FI)V", (void *) android_glGetSamplerParameterfv__II_3FI },
  4897. {"glGetSamplerParameterfv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetSamplerParameterfv__IILjava_nio_FloatBuffer_2 },
  4898. {"glVertexAttribDivisor", "(II)V", (void *) android_glVertexAttribDivisor__II },
  4899. {"glBindTransformFeedback", "(II)V", (void *) android_glBindTransformFeedback__II },
  4900. {"glDeleteTransformFeedbacks", "(I[II)V", (void *) android_glDeleteTransformFeedbacks__I_3II },
  4901. {"glDeleteTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteTransformFeedbacks__ILjava_nio_IntBuffer_2 },
  4902. {"glGenTransformFeedbacks", "(I[II)V", (void *) android_glGenTransformFeedbacks__I_3II },
  4903. {"glGenTransformFeedbacks", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenTransformFeedbacks__ILjava_nio_IntBuffer_2 },
  4904. {"glIsTransformFeedback", "(I)Z", (void *) android_glIsTransformFeedback__I },
  4905. {"glPauseTransformFeedback", "()V", (void *) android_glPauseTransformFeedback__ },
  4906. {"glResumeTransformFeedback", "()V", (void *) android_glResumeTransformFeedback__ },
  4907. {"glGetProgramBinary", "(II[II[IILjava/nio/Buffer;)V", (void *) android_glGetProgramBinary__II_3II_3IILjava_nio_Buffer_2 },
  4908. {"glGetProgramBinary", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/Buffer;)V", (void *) android_glGetProgramBinary__IILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_Buffer_2 },
  4909. {"glProgramBinary", "(IILjava/nio/Buffer;I)V", (void *) android_glProgramBinary__IILjava_nio_Buffer_2I },
  4910. {"glProgramParameteri", "(III)V", (void *) android_glProgramParameteri__III },
  4911. {"glInvalidateFramebuffer", "(II[II)V", (void *) android_glInvalidateFramebuffer__II_3II },
  4912. {"glInvalidateFramebuffer", "(IILjava/nio/IntBuffer;)V", (void *) android_glInvalidateFramebuffer__IILjava_nio_IntBuffer_2 },
  4913. {"glInvalidateSubFramebuffer", "(II[IIIIII)V", (void *) android_glInvalidateSubFramebuffer__II_3IIIIII },
  4914. {"glInvalidateSubFramebuffer", "(IILjava/nio/IntBuffer;IIII)V", (void *) android_glInvalidateSubFramebuffer__IILjava_nio_IntBuffer_2IIII },
  4915. {"glTexStorage2D", "(IIIII)V", (void *) android_glTexStorage2D__IIIII },
  4916. {"glTexStorage3D", "(IIIIII)V", (void *) android_glTexStorage3D__IIIIII },
  4917. {"glGetInternalformativ", "(IIII[II)V", (void *) android_glGetInternalformativ__IIII_3II },
  4918. {"glGetInternalformativ", "(IIIILjava/nio/IntBuffer;)V", (void *) android_glGetInternalformativ__IIIILjava_nio_IntBuffer_2 },
  4919. {"glReadPixels", "(IIIIIII)V", (void *) android_glReadPixels__IIIIIII },
  4920. };
  4921. int register_android_opengl_jni_GLES30(JNIEnv *_env)
  4922. {
  4923. int err;
  4924. err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
  4925. return err;
  4926. }