Class GLShaderProgram

    • Constructor Detail

      • GLShaderProgram

        public GLShaderProgram​(java.lang.String shader_name,
                               ShaderManager manager,
                               ShaderVariableInterface var_interface)
                        throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • loadSource

        protected ShaderSource loadSource​(java.lang.String shader_name,
                                          ShaderType type)
                                   throws java.io.IOException
        Description copied from class: ShaderProgram
        Loads and creates a new shader source.
        Specified by:
        loadSource in class ShaderProgram
        Parameters:
        shader_name - The name of the shader to load
        type - The type of shader to load
        Returns:
        The new shader
        Throws:
        java.io.IOException - If shader file could not be read
      • link

        protected void link()
        Description copied from class: ShaderProgram
        Links all of the shader sources together
        Specified by:
        link in class ShaderProgram
      • validate

        protected void validate()
        Description copied from class: ShaderProgram
        Validates that the shader program linked correctly
        Specified by:
        validate in class ShaderProgram
      • delete

        public void delete()
        Description copied from class: ShaderProgram
        Deletes this shader from the GPU. It will no longer be usable after this point.
        Specified by:
        delete in class ShaderProgram
      • errorCheck

        public void errorCheck​(java.lang.String info)
        Description copied from class: ShaderProgram
        Does api specific error checking
        Specified by:
        errorCheck in class ShaderProgram
        Parameters:
        info - A message that should be reported with the error
      • bindAttributes

        public void bindAttributes​(int byte_offset,
                                   ShaderVariable... attributes)
        Description copied from class: ShaderProgram
        Binds the specified attributes to the GPU
        Specified by:
        bindAttributes in class ShaderProgram
        Parameters:
        byte_offset - The offset between subsequent data packets in the vbo
        attributes - The attributes, in order, that occur in each data packet
      • unbindAttributes

        public void unbindAttributes​(ShaderVariable... attributes)
        Description copied from class: ShaderProgram
        Unbinds already bound attributes from the GPU.
        Specified by:
        unbindAttributes in class ShaderProgram
        Parameters:
        attributes - The attributes to unbind from the GPU
      • loadShaderVariables

        protected void loadShaderVariables​(SymbolTable variables)
        Description copied from class: ShaderProgram
        This function is responsible for loading all shader variables and adding them to the passed symbol table. Any variables not added to this symbol table will not be accessible through the getter functions.
        Specified by:
        loadShaderVariables in class ShaderProgram
        Parameters:
        variables - The symbol table to build