Class DynamicShaderBlockImpl<T>
java.lang.Object
foundry.veil.impl.client.render.shader.definition.ShaderBlockImpl<T>
foundry.veil.impl.client.render.shader.definition.DynamicShaderBlockImpl<T>
- Type Parameters:
T
- The type of object to serialize
- All Implemented Interfaces:
DynamicShaderBlock<T>
,ShaderBlock<T>
,AutoCloseable
,org.lwjgl.system.NativeResource
@Internal
public class DynamicShaderBlockImpl<T>
extends ShaderBlockImpl<T>
implements DynamicShaderBlock<T>
Dynamic-size implementation of
ShaderBlock
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
static final class
static interface
Nested classes/interfaces inherited from interface foundry.veil.api.client.render.shader.definition.ShaderBlock
ShaderBlock.BufferBinding, ShaderBlock.MemoryLayout
-
Field Summary
Fields inherited from class foundry.veil.impl.client.render.shader.definition.ShaderBlockImpl
binding, buffer, dirty, value
-
Constructor Summary
ConstructorDescriptionDynamicShaderBlockImpl
(ShaderBlock.BufferBinding binding, long initialSize, DynamicShaderBlockImpl.Serializer<T> serializer) -
Method Summary
Methods inherited from class foundry.veil.impl.client.render.shader.definition.ShaderBlockImpl
free, getBinding, getValue, set
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, free
Methods inherited from interface foundry.veil.api.client.render.shader.definition.ShaderBlock
getValue, set, update
-
Constructor Details
-
DynamicShaderBlockImpl
public DynamicShaderBlockImpl(ShaderBlock.BufferBinding binding, long initialSize, DynamicShaderBlockImpl.Serializer<T> serializer)
-
-
Method Details
-
getSize
public long getSize()- Specified by:
getSize
in interfaceDynamicShaderBlock<T>
- Returns:
- The size of this block in bytes
-
setSize
public void setSize(long size) Description copied from interface:DynamicShaderBlock
Resizes this shader block to match the new size.- Specified by:
setSize
in interfaceDynamicShaderBlock<T>
- Parameters:
size
- The size in bytes
-
bind
public void bind(int index) Description copied from class:ShaderBlockImpl
Binds this block to the specified index.- Specified by:
bind
in classShaderBlockImpl<T>
- Parameters:
index
- The index to bind this block to
-
unbind
public void unbind(int index) Description copied from class:ShaderBlockImpl
Unbinds this block from the specified index.- Specified by:
unbind
in classShaderBlockImpl<T>
- Parameters:
index
- The index to unbind this block from
-