rtmp/src/main/java/com/example/test/rmtp/util/OpenglUtil.java
/**
     *
     * @param vertexShaderCode
     * @param fragmentShaderCode
     * @return program id
     */
@param vertexShaderCode
@param fragmentShaderCode
@return program id
@param vertexShaderCode @param fragmentShaderCode @return program id
public static int createGLProgram(String vertexShaderCode,String fragmentShaderCode){
        int programId = GLES20.glCreateProgram();
        int vertexShader = GLES20.glCreateShader(GLES20.GL_VERTEX_SHADER);
        int fragmentShader= GLES20.glCreateShader(GLES20.GL_FRAGMENT_SHADER);
        GLES20.glShaderSource(vertexShader, vertexShaderCode);
        GLES20.glShaderSource(fragmentShader, fragmentShaderCode);
        GLES20.glCompileShader(vertexShader);
        GLES20.glCompileShader(fragmentShader);
        GLES20.glAttachShader(programId, vertexShader);
        GLES20.glAttachShader(programId, fragmentShader);
        GLES20.glLinkProgram(programId);
        OpenglUtil.checkGLError();
        return programId;
    }
public static int createGLProgram ( String vertexShaderCode , String fragmentShaderCode ) { int programId = GLES20 . glCreateProgram ( ) ; int vertexShader = GLES20 . glCreateShader ( GLES20 . GL_VERTEX_SHADER ) ; int fragmentShader = GLES20 . glCreateShader ( GLES20 . GL_FRAGMENT_SHADER ) ; GLES20 . glShaderSource ( vertexShader , vertexShaderCode ) ; GLES20 . glShaderSource ( fragmentShader , fragmentShaderCode ) ; GLES20 . glCompileShader ( vertexShader ) ; GLES20 . glCompileShader ( fragmentShader ) ; GLES20 . glAttachShader ( programId , vertexShader ) ; GLES20 . glAttachShader ( programId , fragmentShader ) ; GLES20 . glLinkProgram ( programId ) ; OpenglUtil . checkGLError ( ) ; return programId ; }
@param vertexShaderCode
 @param fragmentShaderCode
 @return program id
@param vertexShaderCode @param fragmentShaderCode @return program id