Home | History | Annotate | Download | only in gles11
      1 /* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */
      2 static
      3 void
      4 android_glTransformFeedbackVaryings
      5     (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) {
      6     jint _exception = 0;
      7     const char* _exceptionType = NULL;
      8     const char* _exceptionMessage = NULL;
      9     jint _count = 0, _i;
     10     const char** _varyings = NULL;
     11     const char* _varying = NULL;
     12 
     13     if (!varyings_ref) {
     14         _exception = 1;
     15         _exceptionType = "java/lang/IllegalArgumentException";
     16         _exceptionMessage = "varyings == null";
     17         goto exit;
     18     }
     19 
     20     _count = _env->GetArrayLength(varyings_ref);
     21     _varyings = (const char**)calloc(_count, sizeof(const char*));
     22     for (_i = 0; _i < _count; _i++) {
     23         jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
     24         if (!_varying) {
     25             _exception = 1;
     26             _exceptionType = "java/lang/IllegalArgumentException";
     27             _exceptionMessage = "null varyings element";
     28             goto exit;
     29         }
     30         _varyings[_i] = _env->GetStringUTFChars(_varying, 0);
     31     }
     32 
     33     glTransformFeedbackVaryings(program, _count, _varyings, bufferMode);
     34 
     35 exit:
     36     for (_i = _count - 1; _i >= 0; _i--) {
     37         if (_varyings[_i]) {
     38             jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
     39             if (_varying) {
     40                 _env->ReleaseStringUTFChars(_varying, _varyings[_i]);
     41             }
     42         }
     43     }
     44     free(_varyings);
     45     if (_exception) {
     46         jniThrowException(_env, _exceptionType, _exceptionMessage);
     47     }
     48 }
     49 
     50