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 Details

    • binding

      protected final ShaderBlock.BufferBinding binding
    • buffer

      protected int buffer
    • value

      protected T value
    • dirty

      protected boolean dirty
  • Constructor Details

  • 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 ShaderBlock.BufferBinding 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