com.io7m.jcanephora.core.api

## Interface JCGLShadersType

- All Superinterfaces:
    JCGLShaderUniformsType

      public interface JCGLShadersType
      extends JCGLShaderUniformsType

  The interface to shader compilation and use.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Optional<JCGLProgramShaderUsableType>` | `shaderActivatedProgram()`
    `void` | `shaderActivateProgram(JCGLProgramShaderUsableType p)` Activate the given program for use in rendering.
    `JCGLFragmentShaderType` | `shaderCompileFragment(String name, List<String> lines)` Read a GLSL fragment shader from the lines of GLSL source code given in `lines`.
    `JCGLGeometryShaderType` | `shaderCompileGeometry(String name, List<String> lines)` Read a GLSL geometry shader from the lines of GLSL source code given in `lines`.
    `JCGLVertexShaderType` | `shaderCompileVertex(String name, List<String> lines)` Read a GLSL vertex shader from the lines of GLSL source code given in `lines`.
    `void` | `shaderDeactivateProgram()` Deactivate any active program.
    `void` | `shaderDeleteFragment(JCGLFragmentShaderType f)` Delete the given shader.
    `void` | `shaderDeleteGeometry(JCGLGeometryShaderType g)` Delete the given shader.
    `void` | `shaderDeleteProgram(JCGLProgramShaderType p)` Delete the given shader.
    `void` | `shaderDeleteVertex(JCGLVertexShaderType v)` Delete the given shader.
    `JCGLProgramShaderType` | `shaderLinkProgram(String name, JCGLVertexShaderUsableType v, Optional<JCGLGeometryShaderUsableType> g, JCGLFragmentShaderUsableType f)` Link a program consisting of the vertex shader `v`, the optional geometry shader `g`, and the fragment shader `f`.

    - ### Methods inherited from interface com.io7m.jcanephora.core.api.JCGLShaderUniformsType

      `shaderUniformPutFloat, shaderUniformPutInteger, shaderUniformPutMatrix3x3f, shaderUniformPutMatrix4x4f, shaderUniformPutTexture2DUnit, shaderUniformPutTextureCubeUnit, shaderUniformPutUnsignedInteger, shaderUniformPutVector2f, shaderUniformPutVector2i, shaderUniformPutVector2ui, shaderUniformPutVector3f, shaderUniformPutVector3i, shaderUniformPutVector3ui, shaderUniformPutVector4f, shaderUniformPutVector4i, shaderUniformPutVector4ui, shaderUniformPutVectorf, shaderUniformSetActivityCheckingEnabled, shaderUniformSetTypeCheckingEnabled`

- - ### Method Detail

    - #### shaderDeleteProgram

          void shaderDeleteProgram(JCGLProgramShaderType p)
                            throws JCGLException,
                                   JCGLExceptionDeleted

      Delete the given shader.
      Parameters:
        `p` - The shader
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionDeleted` - Iff the shader is already deleted

    - #### shaderDeleteVertex

          void shaderDeleteVertex(JCGLVertexShaderType v)
                           throws JCGLException,
                                  JCGLExceptionDeleted

      Delete the given shader.
      Parameters:
        `v` - The shader
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionDeleted` - Iff the shader is already deleted

    - #### shaderDeleteFragment

          void shaderDeleteFragment(JCGLFragmentShaderType f)
                             throws JCGLException,
                                    JCGLExceptionDeleted

      Delete the given shader.
      Parameters:
        `f` - The shader
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionDeleted` - Iff the shader is already deleted

    - #### shaderDeleteGeometry

          void shaderDeleteGeometry(JCGLGeometryShaderType g)
                             throws JCGLException,
                                    JCGLExceptionDeleted

      Delete the given shader.
      Parameters:
        `g` - The shader
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionDeleted` - Iff the shader is already deleted

    - #### shaderCompileVertex

          JCGLVertexShaderType shaderCompileVertex(String name,
                                                   List<String> lines)
                                            throws JCGLExceptionProgramCompileError,
                                                   JCGLException

      Read a GLSL vertex shader from the lines of GLSL source code given in `lines`. Each line must be terminated with an end-of-line terminator (GLSL accepts both LF and CRLF as EOL tokens). The program will be named `name` in any error messages.
      Parameters:
        `name` - The name of the program
        `lines` - A list of lines of GLSL source code
      Returns:
        A reference to the compiled vertex shader
      Throws:
        `JCGLExceptionProgramCompileError` - Iff a compilation error occurs
        `JCGLException` - Iff an OpenGL error occurs

    - #### shaderCompileFragment

          JCGLFragmentShaderType shaderCompileFragment(String name,
                                                       List<String> lines)
                                                throws JCGLExceptionProgramCompileError,
                                                       JCGLException

      Read a GLSL fragment shader from the lines of GLSL source code given in `lines`. Each line must be terminated with an end-of-line terminator (GLSL accepts both LF and CRLF as EOL tokens). The program will be named `name` in any error messages.
      Parameters:
        `name` - The name of the program
        `lines` - A list of lines of GLSL source code
      Returns:
        A reference to the compiled fragment shader
      Throws:
        `JCGLExceptionProgramCompileError` - Iff a compilation error occurs
        `JCGLException` - Iff an OpenGL error occurs

    - #### shaderCompileGeometry

          JCGLGeometryShaderType shaderCompileGeometry(String name,
                                                       List<String> lines)
                                                throws JCGLExceptionProgramCompileError,
                                                       JCGLException

      Read a GLSL geometry shader from the lines of GLSL source code given in `lines`. Each line must be terminated with an end-of-line terminator (GLSL accepts both LF and CRLF as EOL tokens). The program will be named `name` in any error messages.
      Parameters:
        `name` - The name of the program
        `lines` - A list of lines of GLSL source code
      Returns:
        A reference to the compiled geometry shader
      Throws:
        `JCGLExceptionProgramCompileError` - Iff a compilation error occurs
        `JCGLException` - Iff an OpenGL error occurs

    - #### shaderLinkProgram

          JCGLProgramShaderType shaderLinkProgram(String name,
                                                  JCGLVertexShaderUsableType v,
                                                  Optional<JCGLGeometryShaderUsableType> g,
                                                  JCGLFragmentShaderUsableType f)
                                           throws JCGLExceptionProgramCompileError,
                                                  JCGLException,
                                                  JCGLExceptionDeleted

      Link a program consisting of the vertex shader `v`, the optional geometry shader `g`, and the fragment shader `f`.
      Parameters:
        `name` - The name of the program
        `v` - A vertex shader
        `g` - A geometry shader, if required
        `f` - A fragment shader
      Returns:
        A linked program
      Throws:
        `JCGLExceptionProgramCompileError` - Iff the program cannot be linked
        `JCGLExceptionDeleted` - Iff any of the shaders have been deleted
        `JCGLException` - Iff an OpenGL error occurs

    - #### shaderActivateProgram

          void shaderActivateProgram(JCGLProgramShaderUsableType p)
                              throws JCGLException,
                                     JCGLExceptionDeleted

      Activate the given program for use in rendering.
      Parameters:
        `p` - The program
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionDeleted` - Iff the shader has been deleted

    - #### shaderDeactivateProgram

          void shaderDeactivateProgram()
                                throws JCGLException

      Deactivate any active program. If no program is active, the call has no effect.
      Throws:
        `JCGLException` - Iff an OpenGL error occurs

    - #### shaderActivatedProgram

          Optional<JCGLProgramShaderUsableType> shaderActivatedProgram()
                                                                throws JCGLException

      Returns:
        The currently activated program, if any
      Throws:
        `JCGLException` - Iff an OpenGL error occurs

Copyright © 2016 <code@io7m.com> http://io7m.com