// Path: vrlib/src/main/java/com/martin/ads/vrlib/utils/ShaderUtils.java
// public static void checkGlError(String label) {
//     int error;
//     while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
//         Log.e(TAG, label + ": glError " + error);
//         throw new RuntimeException(label + ": glError " + error);
//     }
// }


import android.content.Context;
import android.opengl.GLES20;
import static com.martin.ads.vrlib.utils.ShaderUtils.checkGlError;
package com.martin.ads.vrlib.programs;



/**
 * Created by Ads on 2016/11/20.
 */

//It is optional to split reference to a program
public class GLTwoInputProgram extends GLAbsProgram {
    private int uTextureSamplerHandle;
    private int maTexture2Handle;

    public GLTwoInputProgram(Context context,
                             final String vertexShaderPath,
                             final String fragmentShaderPath) {
        super(context, vertexShaderPath, fragmentShaderPath);
    }

    @Override
    public void create() {
        super.create();
        maTexture2Handle = GLES20.glGetAttribLocation(getProgramId(), "aTextureCoord2");
// Path: vrlib/src/main/java/com/martin/ads/vrlib/utils/ShaderUtils.java
// public static void checkGlError(String label) {
//     int error;
//     while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
//         Log.e(TAG, label + ": glError " + error);
//         throw new RuntimeException(label + ": glError " + error);
//     }
// }


// Path: vrlib/src/main/java/com/martin/ads/vrlib/programs/GLTwoInputProgram.java
import android.content.Context;
import android.opengl.GLES20;
import static com.martin.ads.vrlib.utils.ShaderUtils.checkGlError;

package com.martin.ads.vrlib.programs;



/**
 * Created by Ads on 2016/11/20.
 */

//It is optional to split reference to a program
public class GLTwoInputProgram extends GLAbsProgram {
    private int uTextureSamplerHandle;
    private int maTexture2Handle;

    public GLTwoInputProgram(Context context,
                             final String vertexShaderPath,
                             final String fragmentShaderPath) {
        super(context, vertexShaderPath, fragmentShaderPath);
    }

    @Override
    public void create() {
        super.create();
        maTexture2Handle = GLES20.glGetAttribLocation(getProgramId(), "aTextureCoord2");
        checkGlError("glGetAttribLocation aTextureCoord");