Class GlUtil.Program

  • Enclosing class:
    GlUtil

    public static final class GlUtil.Program
    extends Object
    GL 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 - The Context.
        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 an GlUtil.Attribute.
      • getUniformLocation

        public int getUniformLocation​(String uniformName)
        Returns the location of a GlUtil.Uniform.