Class Template<T>

java.lang.Object
com.jozufozu.flywheel.core.compile.Memoizer<SourceFile,T>
com.jozufozu.flywheel.core.compile.Template<T>

public class Template<T> extends Memoizer<SourceFile,T>
A class that generates glsl glue code given a SourceFile.

Shader files are written somewhat abstractly. Subclasses of Template handle those abstractions, using SourceFile metadata to generate shader code that OpenGL can use to call into our shader programs.

  • Constructor Details

  • Method Details

    • apply

      public T apply(SourceFile file)
      Verify that the given SourceFile is valid for this Template and return the metadata.
      Parameters:
      file - The SourceFile to apply this Template to.
      Returns:
      The applied template metadata.
    • getVersion

      public GLSLVersion getVersion()
      Returns:
      The GLSL version this template requires.
    • _create

      protected T _create(SourceFile key)
      Specified by:
      _create in class Memoizer<SourceFile,T>
    • _destroy

      protected void _destroy(T value)
      Specified by:
      _destroy in class Memoizer<SourceFile,T>