Class AbstractShaderObject

java.lang.Object
codechicken.lib.render.shader.NamedShaderObject
codechicken.lib.render.shader.AbstractShaderObject
All Implemented Interfaces:
ShaderObject
Direct Known Subclasses:
AssetShaderObject, SimpleShaderObject

public abstract class AbstractShaderObject extends NamedShaderObject
Created by covers1624 on 24/5/20.
  • Field Details

    • shaderId

      protected int shaderId
    • dirty

      protected boolean dirty
  • Constructor Details

  • Method Details

    • isDirty

      public boolean isDirty()
      Description copied from interface: ShaderObject
      Checks if this shader is dirty and requires re-compiling.
      Returns:
      If this shader is dirty.
    • alloc

      public void alloc()
      Description copied from interface: ShaderObject
      Allocates and compiles this ShaderObject. Does nothing if the shader is already compiled.
    • getShaderID

      public int getShaderID()
      Description copied from interface: ShaderObject
      Gets the GL id for this ShaderObject.
      Returns:
      The id, -1 of not allocated.
    • onLink

      public void onLink(int programId)
      Description copied from interface: ShaderObject
      Called when this ShaderObject is linked to a ShaderProgram.
      Parameters:
      programId - The GL id of the program.
    • getSource

      protected abstract String getSource()