VertexBufferLayout


public final class VertexBufferLayout


Layout of a vertex buffer, composed of multiple attribute descriptors.

If the stride is set to AUTO_STRIDE, the stride will be computed automatically to be the minimum byte stride required to encompass all attributes in the buffer. The stride must be AUTO_STRIDE or a positive value up to MAX_STRIDE.

Throws
IllegalArgumentException

if attributes is empty, if stride is not AUTO_STRIDE and not between 1 and MAX_STRIDE, if any attributes overlap, or if stride is not AUTO_STRIDE and is smaller than the minimum byte stride required to encompass all attributes.

Summary

Constants

static final int

Indicates that the buffer stride should be computed automatically to be the minimum byte stride required to encompass all attributes in the buffer.

static final int
MAX_STRIDE = 32767

The maximum allowed byte stride for a vertex buffer (32767).

Public constructors

VertexBufferLayout(
    @NonNull List<@NonNull VertexAttributeDescriptor> attributes,
    @IntRange(from = -1, to = 32767) int stride
)

Public methods

boolean
equals(Object other)
final @NonNull List<@NonNull VertexAttributeDescriptor>

List of VertexAttributeDescriptors defining the layout within this buffer.

final int

The byte stride of the buffer.

int
@NonNull String

Constants

AUTO_STRIDE

public static final int AUTO_STRIDE

Indicates that the buffer stride should be computed automatically to be the minimum byte stride required to encompass all attributes in the buffer.

MAX_STRIDE

public static final int MAX_STRIDE = 32767

The maximum allowed byte stride for a vertex buffer (32767).

Public constructors

VertexBufferLayout

Added in 1.0.0-alpha16
public VertexBufferLayout(
    @NonNull List<@NonNull VertexAttributeDescriptor> attributes,
    @IntRange(from = -1, to = 32767) int stride
)
Parameters
@NonNull List<@NonNull VertexAttributeDescriptor> attributes

List of VertexAttributeDescriptors defining the layout within this buffer.

@IntRange(from = -1, to = 32767) int stride

The byte stride of the buffer.

Public methods

equals

public boolean equals(Object other)

getAttributes

Added in 1.0.0-alpha16
public final @NonNull List<@NonNull VertexAttributeDescriptorgetAttributes()

List of VertexAttributeDescriptors defining the layout within this buffer.

getStride

Added in 1.0.0-alpha16
public final int getStride()

The byte stride of the buffer.

hashCode

public int hashCode()

toString

public @NonNull String toString()