VertexBufferLayout


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

const Int

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

const Int
MAX_STRIDE = 32767

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

Public constructors

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

Public functions

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

Public properties

List<VertexAttributeDescriptor>

List of VertexAttributeDescriptors defining the layout within this buffer.

Int

The byte stride of the buffer.

Constants

AUTO_STRIDE

const val AUTO_STRIDEInt

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

const val MAX_STRIDE = 32767: Int

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

Public constructors

VertexBufferLayout

Added in 1.0.0-alpha16
VertexBufferLayout(
    attributes: List<VertexAttributeDescriptor>,
    stride: @IntRange(from = -1, to = 32767) Int = AUTO_STRIDE
)
Parameters
attributes: List<VertexAttributeDescriptor>

List of VertexAttributeDescriptors defining the layout within this buffer.

stride: @IntRange(from = -1, to = 32767) Int = AUTO_STRIDE

The byte stride of the buffer.

Public functions

equals

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

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

attributes

Added in 1.0.0-alpha16
val attributesList<VertexAttributeDescriptor>

List of VertexAttributeDescriptors defining the layout within this buffer.

stride

Added in 1.0.0-alpha16
val strideInt

The byte stride of the buffer.