BufferObject

class BufferObject(nativeHandle: NativePointer)

A generic GPU buffer for storing data.

BufferObject usage is optional and mainly useful when you need to share data between multiple VertexBuffer instances. It also allows you to efficiently swap-out buffers in VertexBuffer.

For simple use cases where you don't need to share data, it is not necessary to use BufferObject. The buffer is created uninitialized; use setBuffer() to initialize it.

See also

, IndexBuffer

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Types

Link copied to clipboard

Binding type options for BufferObject.

Link copied to clipboard
class Builder

Builder for creating BufferObject instances.

Properties

Link copied to clipboard

Gets the size of this BufferObject in bytes.

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)

Asynchronously copies data to initialize a region of this BufferObject.

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

Asynchronously copies data to a region of this BufferObject with offset and count.

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

Asynchronously copies data to a region of this BufferObject with callback.