VertexAttributeDescriptor


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

const 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.

const Int
MAX_OFFSET = 32767

The maximum allowed byte offset for a vertex attribute.

Public constructors

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

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

VertexAttribute

The VertexAttribute semantic of the attribute.

Int

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

VertexAttributeType

The VertexAttributeType data type of the attribute.

Constants

AUTO_OFFSET

const val AUTO_OFFSETInt

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

const val MAX_OFFSET = 32767: Int

The maximum allowed byte offset for a vertex attribute.

Public constructors

VertexAttributeDescriptor

Added in 1.0.0-alpha16
VertexAttributeDescriptor(
    attribute: VertexAttribute,
    type: VertexAttributeType,
    offset: @IntRange(from = -1, to = 32767) Int = AUTO_OFFSET
)
Parameters
attribute: VertexAttribute

The VertexAttribute semantic of the attribute.

type: VertexAttributeType

The VertexAttributeType data type of the attribute.

offset: @IntRange(from = -1, to = 32767) Int = AUTO_OFFSET

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

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

attribute

Added in 1.0.0-alpha16
val attributeVertexAttribute

The VertexAttribute semantic of the attribute.

offset

Added in 1.0.0-alpha16
val offsetInt

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

type

Added in 1.0.0-alpha16
val typeVertexAttributeType

The VertexAttributeType data type of the attribute.