IndexBuffer

class IndexBuffer(nativeHandle: NativePointer)

A buffer containing vertex indices into a VertexBuffer.

IndexBuffer holds a sequence of indices that reference vertices in an associated VertexBuffer. Indices can be 16-bit (USHORT) or 32-bit (UINT). Typically used in conjunction with RenderableManager to define the geometry of primitives.

See also

, RenderableManager

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Types

Link copied to clipboard
class Builder

Builder for creating IndexBuffer instances.

Link copied to clipboard

Type of the index buffer.

Properties

Link copied to clipboard

Gets the number of indices in this buffer.

Link copied to clipboard

Returns whether the asynchronous creation of this IndexBuffer has completed; always true when it wasn't built with Builder.async().

Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Functions

Link copied to clipboard
fun setBuffer(engine: Engine, data: ByteArray)

Sets the index data for this buffer.

fun setBuffer(engine: Engine, data: ByteArray, destOffsetInBytes: Int, count: Int)

Sets the index data with offset and count.

fun setBuffer(engine: Engine, data: ByteArray, destOffsetInBytes: Int, count: Int, callback: () -> Unit? = null)

Sets the index data with offset, count, and optional completion callback.

Link copied to clipboard
fun setBufferAsync(engine: Engine, data: ByteArray, destOffsetInBytes: Int = 0, count: Int = 0, callback: (IndexBuffer, AsyncCallStatus) -> Unit? = null): Int

setBuffer, asynchronously: returns an ID for Engine.cancelAsyncCall, and callback runs once on the main thread with how it ended. Needs Engine.isAsynchronousModeEnabled.