Class GlUtil.Program
- java.lang.Object
-
- com.google.android.exoplayer2.util.GlUtil.Program
-
-
Constructor Summary
Constructors Constructor Description Program(Context context, String vertexShaderFilePath, String fragmentShaderFilePath)Compiles a GL shader program from vertex and fragment shader GLSL GLES20 code.Program(String[] vertexShaderGlsl, String[] fragmentShaderGlsl)Compiles a GL shader program from vertex and fragment shader GLSL GLES20 code.Program(String vertexShaderGlsl, String fragmentShaderGlsl)Compiles a GL shader program from vertex and fragment shader GLSL GLES20 code.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()Deletes the program.intgetAttribLocation(String attributeName)Returns the location of anGlUtil.Attribute.GlUtil.Attribute[]getAttributes()Returns the program'sGlUtil.Attributes.intgetUniformLocation(String uniformName)Returns the location of aGlUtil.Uniform.GlUtil.Uniform[]getUniforms()Returns the program'sGlUtil.Uniforms.voiduse()Uses the program.
-
-
-
Constructor Detail
-
Program
public Program(String vertexShaderGlsl, String fragmentShaderGlsl)
Compiles a GL shader program from vertex and fragment shader GLSL GLES20 code.- Parameters:
vertexShaderGlsl- The vertex shader program.fragmentShaderGlsl- The fragment shader program.
-
Program
public Program(Context context, String vertexShaderFilePath, String fragmentShaderFilePath) throws IOException
Compiles a GL shader program from vertex and fragment shader GLSL GLES20 code.- Parameters:
context- TheContext.vertexShaderFilePath- The path to a vertex shader program.fragmentShaderFilePath- The path to a fragment shader program.- Throws:
IOException- When failing to read shader files.
-
Program
public Program(String[] vertexShaderGlsl, String[] fragmentShaderGlsl)
Compiles a GL shader program from vertex and fragment shader GLSL GLES20 code.- Parameters:
vertexShaderGlsl- The vertex shader program as arrays of strings. Strings are joined by adding a new line character in between each of them.fragmentShaderGlsl- The fragment shader program as arrays of strings. Strings are joined by adding a new line character in between each of them.
-
-
Method Detail
-
use
public void use()
Uses the program.
-
delete
public void delete()
Deletes the program. Deleted programs cannot be used again.
-
getAttribLocation
public int getAttribLocation(String attributeName)
Returns the location of anGlUtil.Attribute.
-
getUniformLocation
public int getUniformLocation(String uniformName)
Returns the location of aGlUtil.Uniform.
-
getAttributes
public GlUtil.Attribute[] getAttributes()
Returns the program'sGlUtil.Attributes.
-
getUniforms
public GlUtil.Uniform[] getUniforms()
Returns the program'sGlUtil.Uniforms.
-
-