Class ShaderBlockImpl<T>

java.lang.Object
foundry.veil.impl.client.render.shader.definition.ShaderBlockImpl<T>
Type Parameters:
T - The type of object to serialize
All Implemented Interfaces:
ShaderBlock<T>, AutoCloseable, org.lwjgl.system.NativeResource
Direct Known Subclasses:
DynamicShaderBlockImpl, SizedShaderBlockImpl, WrapperShaderBlockImpl

@Internal public abstract class ShaderBlockImpl<T> extends Object implements ShaderBlock<T>
Abstract implementation of ShaderBlock.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final int
     
    protected int
     
    protected boolean
     
    protected T
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ShaderBlockImpl(int binding)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    bind(int index)
    Binds this block to the specified index.
    void
     
    int
     
     
    void
    set(T value)
    Sets the value of this block.
    abstract void
    unbind(int index)
    Unbinds this block from the specified index.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.lwjgl.system.NativeResource

    close

    Methods inherited from interface foundry.veil.api.client.render.shader.definition.ShaderBlock

    update
  • Field Details

    • binding

      protected final int binding
    • buffer

      protected int buffer
    • value

      protected T value
    • dirty

      protected boolean dirty
  • Constructor Details

    • ShaderBlockImpl

      protected ShaderBlockImpl(int binding)
  • Method Details

    • set

      public void set(@Nullable T value)
      Description copied from interface: ShaderBlock
      Sets the value of this block. Sets the value regardless if it has changed or not.
      Specified by:
      set in interface ShaderBlock<T>
      Parameters:
      value - The new value
    • bind

      public abstract void bind(int index)
      Binds this block to the specified index.
      Parameters:
      index - The index to bind this block to
    • unbind

      public abstract void unbind(int index)
      Unbinds this block from the specified index.
      Parameters:
      index - The index to unbind this block from
    • getBinding

      public int getBinding()
    • getValue

      @Nullable public T getValue()
      Specified by:
      getValue in interface ShaderBlock<T>
      Returns:
      The value stored in this block
    • free

      public void free()
      Specified by:
      free in interface org.lwjgl.system.NativeResource