PageRenderTime 75ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 2ms

/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

Large files files are truncated, but you can click here to view the full file

  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, G…

Large files files are truncated, but you can click here to view the full file