Class GLShader.Builder<B extends GLShader.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
GLShader

public static class GLShader.Builder<B extends GLShader.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public GLShader build()
      Finish building the GLShader object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to GLShader.
      Overrides:
      build in class GObject.Builder<B extends GLShader.Builder<B>>
      Returns:
      a new instance of GLShader with the properties that were set in the Builder object.
    • setResource

      public B setResource(String resource)

      Resource containing the source code for the shader.

      If the shader source is not coming from a resource, this will be null.

      Parameters:
      resource - the value for the resource property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setSource

      public B setSource(byte[] source)
      The source code for the shader, as a GBytes.
      Parameters:
      source - the value for the source property
      Returns:
      the Builder instance is returned, to allow method chaining