Class ProgramBuilder.Abstract<GL extends OGLGraphics>

java.lang.Object
com.blackrook.gloop.opengl.util.ProgramBuilder.Abstract<GL>
Type Parameters:
GL - the graphics implementation that this executes on.
All Implemented Interfaces:
ProgramBuilder
Enclosing interface:
ProgramBuilder

public abstract static class ProgramBuilder.Abstract<GL extends OGLGraphics> extends Object implements ProgramBuilder
Shader builder utility class.
  • Field Details

  • Constructor Details

    • Abstract

      protected Abstract(GL gl)
      Creates a new Shader Builder with defaults set.
      Parameters:
      gl - the graphics implementation that created this (and will execute this).
  • Method Details

    • attributeLocation

      public ProgramBuilder attributeLocation(String attributeName, int locationId)
      Description copied from interface: ProgramBuilder
      Binds an attribute name to a specific location index.
      Specified by:
      attributeLocation in interface ProgramBuilder
      Parameters:
      attributeName - the attribute name.
      locationId - the location id.
      Returns:
      this builder.
    • fragmentDataLocation

      public ProgramBuilder fragmentDataLocation(String attributeName, int index)
      Description copied from interface: ProgramBuilder
      Binds a fragment output attribute name to a specific output color index.
      Specified by:
      fragmentDataLocation in interface ProgramBuilder
      Parameters:
      attributeName - the attribute name.
      index - the index.
      Returns:
      this builder.
    • transformFeedbackVaryingNames

      public ProgramBuilder transformFeedbackVaryingNames(FeedbackBufferType type, String... variableNames)
      Description copied from interface: ProgramBuilder
      Sets the transform feedback varying variables for the bound shader program, assuming that what is being built is a "transform feedback"-viable shader program, which entails a vertex shader
      Specified by:
      transformFeedbackVaryingNames in interface ProgramBuilder
      Parameters:
      type - the feedback output type.
      variableNames - the names of the varying variables.
      Returns:
      this builder.
    • setShader

      public ProgramBuilder setShader(ShaderType type, File file)
      Description copied from interface: ProgramBuilder
      Sets a shader program and a shader source.
      Specified by:
      setShader in interface ProgramBuilder
      Parameters:
      type - the shader type.
      file - the source file.
      Returns:
      this builder.
    • setShader

      public ProgramBuilder setShader(ShaderType type, File file, Charset encoding)
      Description copied from interface: ProgramBuilder
      Sets a shader program and a shader source.
      Specified by:
      setShader in interface ProgramBuilder
      Parameters:
      type - the shader type.
      file - the source file.
      encoding - the file encoding type.
      Returns:
      this builder.
    • setShader

      public ProgramBuilder setShader(ShaderType type, InputStream in)
      Description copied from interface: ProgramBuilder
      Sets a shader program and a shader source.
      Specified by:
      setShader in interface ProgramBuilder
      Parameters:
      type - the shader type.
      in - the input stream to read from.
      Returns:
      this builder.
    • setShader

      public ProgramBuilder setShader(ShaderType type, InputStream in, Charset encoding)
      Description copied from interface: ProgramBuilder
      Sets a shader program and a shader source.
      Specified by:
      setShader in interface ProgramBuilder
      Parameters:
      type - the shader type.
      in - the input stream to read from.
      encoding - the file encoding type.
      Returns:
      this builder.
    • setShader

      public ProgramBuilder setShader(ShaderType type, Reader reader)
      Description copied from interface: ProgramBuilder
      Sets a shader program and a shader source.
      Specified by:
      setShader in interface ProgramBuilder
      Parameters:
      type - the shader type.
      reader - the reader to read from.
      Returns:
      this builder.
    • setShader

      public ProgramBuilder setShader(ShaderType type, String source)
      Description copied from interface: ProgramBuilder
      Sets a shader program and a shader source.
      Specified by:
      setShader in interface ProgramBuilder
      Parameters:
      type - the shader type.
      source - the string that contains the source code.
      Returns:
      this builder.
    • setShader

      public ProgramBuilder setShader(ShaderType type, Supplier<String> source)
      Description copied from interface: ProgramBuilder
      Sets a shader program and a shader source.
      Specified by:
      setShader in interface ProgramBuilder
      Parameters:
      type - the shader type.
      source - the source code supplier.
      Returns:
      this builder.
    • setListener

      public ProgramBuilder setListener(ProgramBuilder.Listener listener)
      Description copied from interface: ProgramBuilder
      Sets a log listener to listen for builder events.
      Specified by:
      setListener in interface ProgramBuilder
      Parameters:
      listener - the listener to set.
      Returns:
      this builder.
    • fireShaderLog

      protected final void fireShaderLog(ShaderType type, String log)
      Fires a log event to the listener, if attached.
      Parameters:
      type - the shader type.
      log - the shader log.