Class GlProgram

java.lang.Object
com.jozufozu.flywheel.backend.gl.GlObject
com.jozufozu.flywheel.backend.gl.shader.GlProgram
Direct Known Subclasses:
WorldProgram

public abstract class GlProgram extends GlObject
  • Field Details

    • name

      public final net.minecraft.resources.ResourceLocation name
  • Constructor Details

    • GlProgram

      protected GlProgram(net.minecraft.resources.ResourceLocation name, int handle)
  • Method Details

    • bind

      public void bind()
    • unbind

      public static void unbind()
    • getUniformLocation

      public int getUniformLocation(String uniform)
      Retrieves the index of the uniform with the given name.
      Parameters:
      uniform - The name of the uniform to find the index of
      Returns:
      The uniform's index
    • setSamplerBinding

      public int setSamplerBinding(String name, int binding)
      Binds a sampler uniform to the given texture unit.
      Parameters:
      name - The name of the sampler uniform.
      binding - The index of the texture unit.
      Returns:
      The sampler uniform's index.
      Throws:
      NullPointerException - If no uniform exists with the given name.
    • uploadMatrixUniform

      protected static void uploadMatrixUniform(int uniform, com.mojang.math.Matrix4f mat)
    • deleteInternal

      protected void deleteInternal(int handle)
      Specified by:
      deleteInternal in class GlObject
    • toString

      public String toString()
      Overrides:
      toString in class Object