VertexAttributeDescriptor


public final class VertexAttributeDescriptor


Descriptor for a single vertex attribute.

Defines how a specific vertex attribute is structured within a vertex buffer. If the offset is set to AUTO_OFFSET, the attribute will be placed immediately after the previous attribute in the same buffer, or at the beginning of the vertex data if this is the first attribute. The offset cannot exceed MAX_OFFSET.

Throws
IllegalArgumentException

if the given type is incompatible with the given attribute, or if offset is not AUTO_OFFSET and is not between 0 and MAX_OFFSET.

Summary

Constants

static final int

Indicates that the attribute offset should be computed automatically by placing it immediately after the previous attribute in the same buffer, or at the beginning of the vertex data if this is the first attribute.

static final int
MAX_OFFSET = 32767

The maximum allowed byte offset for a vertex attribute.

Public constructors

VertexAttributeDescriptor(
    @NonNull VertexAttribute attribute,
    @NonNull VertexAttributeType type,
    @IntRange(from = -1, to = 32767) int offset
)

Public methods

boolean
equals(Object other)
final @NonNull VertexAttribute

The VertexAttribute semantic of the attribute.

final int

The byte offset of the attribute from the start of the vertex data.

final @NonNull VertexAttributeType

The VertexAttributeType data type of the attribute.

int
@NonNull String

Constants

AUTO_OFFSET

public static final int AUTO_OFFSET

Indicates that the attribute offset should be computed automatically by placing it immediately after the previous attribute in the same buffer, or at the beginning of the vertex data if this is the first attribute.

MAX_OFFSET

public static final int MAX_OFFSET = 32767

The maximum allowed byte offset for a vertex attribute.

Public constructors

VertexAttributeDescriptor

Added in 1.0.0-alpha16
public VertexAttributeDescriptor(
    @NonNull VertexAttribute attribute,
    @NonNull VertexAttributeType type,
    @IntRange(from = -1, to = 32767) int offset
)
Parameters
@NonNull VertexAttribute attribute

The VertexAttribute semantic of the attribute.

@NonNull VertexAttributeType type

The VertexAttributeType data type of the attribute.

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

The byte offset of the attribute from the start of the vertex data.

Public methods

equals

public boolean equals(Object other)

getAttribute

Added in 1.0.0-alpha16
public final @NonNull VertexAttribute getAttribute()

The VertexAttribute semantic of the attribute.

getOffset

Added in 1.0.0-alpha16
public final int getOffset()

The byte offset of the attribute from the start of the vertex data.

getType

Added in 1.0.0-alpha16
public final @NonNull VertexAttributeType getType()

The VertexAttributeType data type of the attribute.

hashCode

public int hashCode()

toString

public @NonNull String toString()