com.io7m.r2.core.shaders.provided

## Class R2AbstractShader<M>

- java.lang.Object
- - com.io7m.r2.core.shaders.provided.R2AbstractShader<M>

- Type Parameters:
    `M` - The type of shader parameters
  All Implemented Interfaces:
    com.io7m.jcanephora.core.JCGLResourceUsableType, R2DeletableType, R2ShaderType<M>, R2ShaderUsableType<M>
  Direct Known Subclasses:
    R2DebugShaderLightDirectionalConstantSingle, R2DebugShaderLightSphericalAttenuationSingle, R2DebugShaderLightSphericalConstantSingle, R2DepthShaderBasicBatched, R2DepthShaderBasicSingle, R2DepthShaderBasicStippledSingle, R2LightShaderAmbientSingle, R2LightShaderDirectionalSpecularSingle, R2LightShaderProjectiveLambertBlinnPhongShadowVarianceSingle, R2LightShaderProjectiveLambertBlinnPhongSingle, R2LightShaderProjectiveLambertShadowVarianceSingle, R2LightShaderProjectiveLambertSingle, R2LightShaderSphericalLambertBlinnPhongSingle, R2LightShaderSphericalLambertPhongSingle, R2LightShaderSphericalLambertSingle, R2MaskShaderBatched, R2MaskShaderSingle, R2RefractionMaskedDeltaShaderBatched, R2RefractionMaskedDeltaShaderBillboarded, R2RefractionMaskedDeltaShaderSingle, R2ShaderDebugColorVerticesWorldPosition, R2ShaderDebugVisualBatched, R2ShaderDebugVisualBillboarded, R2ShaderDebugVisualScreen, R2ShaderDebugVisualSingle, R2ShaderFilterBilateralBlurDepthAwareHorizontal4f, R2ShaderFilterBilateralBlurDepthAwareVertical4f, R2ShaderFilterBoxBlurHorizontal4f, R2ShaderFilterBoxBlurVertical4f, R2ShaderFilterDebugEyePosition, R2ShaderFilterDebugEyeZ, R2ShaderFilterEmission, R2ShaderFilterFogDepth, R2ShaderFilterFXAAA, R2ShaderFilterLightApplicator, R2ShaderFilterOcclusionApplicator, R2ShaderFilterTextureShow, R2ShaderLogDepthOnlySingle, R2ShaderSSAO, R2StencilShaderScreen, R2StencilShaderSingle, R2SurfaceShaderBasicBatched, R2SurfaceShaderBasicBillboarded, R2SurfaceShaderBasicReflectiveSingle, R2SurfaceShaderBasicSingle, R2SurfaceShaderBasicStippledSingle, R2TranslucentShaderBasicPremultipliedBatched, R2TranslucentShaderBasicPremultipliedBillboarded, R2TranslucentShaderBasicPremultipliedSingle

      public abstract class R2AbstractShader<M>
      extends Object
      implements R2ShaderType<M>

  An abstract shader implementation.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `R2AbstractShader(com.io7m.jcanephora.core.api.JCGLShadersType in_shaders, R2ShaderPreprocessingEnvironmentReadableType in_shader_env, R2IDPoolType in_pool, String in_name, String in_vertex, Optional<String> in_geometry, String in_fragment)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delete(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)` Delete the current object.
    `boolean` | `isDeleted()`
    `void` | `onActivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)` Activate the shader for rendering.
    `void` | `onDeactivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)` Deactivate the shader.
    `long` | `shaderID()`
    `com.io7m.jcanephora.core.JCGLProgramShaderUsableType` | `shaderProgram()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.io7m.r2.core.shaders.types.R2ShaderUsableType

      `onValidate, shaderParametersType`

- - ### Constructor Detail

    - #### R2AbstractShader

          protected R2AbstractShader(com.io7m.jcanephora.core.api.JCGLShadersType in_shaders,
                                     R2ShaderPreprocessingEnvironmentReadableType in_shader_env,
                                     R2IDPoolType in_pool,
                                     String in_name,
                                     String in_vertex,
                                     Optional<String> in_geometry,
                                     String in_fragment)
                              throws R2ExceptionShaderPreprocessingFailed

      Throws:
        `R2ExceptionShaderPreprocessingFailed`

  - ### Method Detail

    - #### isDeleted

          public final boolean isDeleted()

      Specified by:
        `isDeleted` in interface `com.io7m.jcanephora.core.JCGLResourceUsableType`

    - #### onActivate

          public final void onActivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)

      Description copied from interface: `R2ShaderUsableType`
      Activate the shader for rendering.
      Specified by:
        `onActivate` in interface `R2ShaderUsableType<M>`
      Parameters:
        `g` - A GL interface

    - #### onDeactivate

          public final void onDeactivate(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)

      Description copied from interface: `R2ShaderUsableType`
      Deactivate the shader.
      Specified by:
        `onDeactivate` in interface `R2ShaderUsableType<M>`
      Parameters:
        `g` - A GL interface

    - #### delete

          public final void delete(com.io7m.jcanephora.core.api.JCGLInterfaceGL33Type g)

      Description copied from interface: `R2DeletableType`
      Delete the current object.
      Specified by:
        `delete` in interface `R2DeletableType`
      Parameters:
        `g` - An OpenGL interface

    - #### shaderProgram

          public final com.io7m.jcanephora.core.JCGLProgramShaderUsableType shaderProgram()

      Specified by:
        `shaderProgram` in interface `R2ShaderUsableType<M>`
      Returns:
        The compiled shader program

    - #### shaderID

          public final long shaderID()

      Specified by:
        `shaderID` in interface `R2ShaderUsableType<M>`
      Returns:
        The unique shader ID

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