Class LegacyVertexAttribBindingBuilder
java.lang.Object
foundry.veil.impl.client.render.vertex.LegacyVertexAttribBindingBuilder
- All Implemented Interfaces:
VertexArrayBuilder
@Internal
public class LegacyVertexAttribBindingBuilder
extends Object
implements VertexArrayBuilder
-
Nested Class Summary
Nested classes/interfaces inherited from interface foundry.veil.api.client.render.vertex.VertexArrayBuilder
VertexArrayBuilder.DataType
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionClears all defined vertex attributes.Clears all mapped buffer regions.defineVertexBuffer
(int index, int buffer, int offset, int stride, int divisor) Maps a buffer region to the specified index.removeAttribute
(int index) Removes the attribute with the specified index.removeVertexBuffer
(int index) Removes the buffer mapping with the specified index.setVertexAttribute
(int index, int bufferIndex, int size, VertexArrayBuilder.DataType type, boolean normalized, int relativeOffset) Defines a floating-point vertex attribute.setVertexIAttribute
(int index, int bufferIndex, int size, VertexArrayBuilder.DataType type, int relativeOffset) Defines an integer vertex attribute.setVertexLAttribute
(int index, int bufferIndex, int size, VertexArrayBuilder.DataType type, int relativeOffset) Defines a long vertex attribute.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface foundry.veil.api.client.render.vertex.VertexArrayBuilder
applyFrom
-
Constructor Details
-
LegacyVertexAttribBindingBuilder
-
-
Method Details
-
vertexArray
- Specified by:
vertexArray
in interfaceVertexArrayBuilder
- Returns:
- The source vertex array
-
defineVertexBuffer
public VertexArrayBuilder defineVertexBuffer(int index, int buffer, int offset, int stride, int divisor) Description copied from interface:VertexArrayBuilder
Maps a buffer region to the specified index. Allows swapping out vertex data with a single GL call.- Specified by:
defineVertexBuffer
in interfaceVertexArrayBuilder
- Parameters:
index
- The index to assign to. It must be between 0 andVeilRenderSystem.maxVertexAttributes()
buffer
- The buffer to assignoffset
- The offset into the buffer to bind tostride
- The size of the region to mapdivisor
- The number of instances that have to pass to increment this data or0
to increment per vertex
-
setVertexAttribute
public VertexArrayBuilder setVertexAttribute(int index, int bufferIndex, int size, VertexArrayBuilder.DataType type, boolean normalized, int relativeOffset) Description copied from interface:VertexArrayBuilder
Defines a floating-point vertex attribute.- Specified by:
setVertexAttribute
in interfaceVertexArrayBuilder
- Parameters:
index
- The index of the attribute to assignbufferIndex
- The defined buffer index to use. Defined withVertexArrayBuilder.defineVertexBuffer(int, int, int, int, int)
size
- The size of the attribute. Can be 1, 2, 3, or 4type
- The type of data the shader will usenormalized
- Whether to normalize the data from-1
to1
automaticallyrelativeOffset
- The offset in the buffer region the vertex data is defined at. It must be between 0 andVeilRenderSystem.maxVertexAttributeRelativeOffset()
-
setVertexIAttribute
public VertexArrayBuilder setVertexIAttribute(int index, int bufferIndex, int size, VertexArrayBuilder.DataType type, int relativeOffset) Description copied from interface:VertexArrayBuilder
Defines an integer vertex attribute.- Specified by:
setVertexIAttribute
in interfaceVertexArrayBuilder
- Parameters:
index
- The index of the attribute to assignbufferIndex
- The defined buffer index to use. Defined withVertexArrayBuilder.defineVertexBuffer(int, int, int, int, int)
size
- The size of the attribute. Can be 1, 2, 3, or 4type
- The type of data the shader will userelativeOffset
- The offset in the buffer region the vertex data is defined at. It must be between 0 andVeilRenderSystem.maxVertexAttributeRelativeOffset()
-
setVertexLAttribute
public VertexArrayBuilder setVertexLAttribute(int index, int bufferIndex, int size, VertexArrayBuilder.DataType type, int relativeOffset) Description copied from interface:VertexArrayBuilder
Defines a long vertex attribute.- Specified by:
setVertexLAttribute
in interfaceVertexArrayBuilder
- Parameters:
index
- The index of the attribute to assignbufferIndex
- The defined buffer index to use. Defined withVertexArrayBuilder.defineVertexBuffer(int, int, int, int, int)
size
- The size of the attribute. Can be 1, 2, 3, or 4type
- The type of data the shader will userelativeOffset
- The offset in the buffer region the vertex data is defined at. It must be between 0 andVeilRenderSystem.maxVertexAttributeRelativeOffset()
-
removeVertexBuffer
Description copied from interface:VertexArrayBuilder
Removes the buffer mapping with the specified index.- Specified by:
removeVertexBuffer
in interfaceVertexArrayBuilder
- Parameters:
index
- The index of the buffer to remove
-
removeAttribute
Description copied from interface:VertexArrayBuilder
Removes the attribute with the specified index.- Specified by:
removeAttribute
in interfaceVertexArrayBuilder
- Parameters:
index
- The index of the attribute to remove
-
clearVertexBuffers
Description copied from interface:VertexArrayBuilder
Clears all mapped buffer regions.- Specified by:
clearVertexBuffers
in interfaceVertexArrayBuilder
-
clearVertexAttributes
Description copied from interface:VertexArrayBuilder
Clears all defined vertex attributes.- Specified by:
clearVertexAttributes
in interfaceVertexArrayBuilder
-