Record Class ARBVertexAttribBindingBuilder
java.lang.Object
java.lang.Record
foundry.veil.impl.client.render.vertex.ARBVertexAttribBindingBuilder
- All Implemented Interfaces:
VertexArrayBuilder
@Internal
public record ARBVertexAttribBindingBuilder(VertexArray vertexArray)
extends Record
implements VertexArrayBuilder
-
Nested Class Summary
Nested classes/interfaces inherited from interface foundry.veil.api.client.render.vertex.VertexArrayBuilder
VertexArrayBuilder.DataType
-
Constructor Summary
ConstructorDescriptionARBVertexAttribBindingBuilder
(VertexArray vertexArray) Creates an instance of aARBVertexAttribBindingBuilder
record class. -
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.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.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.final String
toString()
Returns a string representation of this record class.Returns the value of thevertexArray
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface foundry.veil.api.client.render.vertex.VertexArrayBuilder
applyFrom
-
Constructor Details
-
ARBVertexAttribBindingBuilder
Creates an instance of aARBVertexAttribBindingBuilder
record class.- Parameters:
vertexArray
- the value for thevertexArray
record component
-
-
Method Details
-
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
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
vertexArray
Returns the value of thevertexArray
record component.- Specified by:
vertexArray
in interfaceVertexArrayBuilder
- Returns:
- the value of the
vertexArray
record component
-