Back to Filament

setBuffer

docs/android/dokka/filament-android/com.google.android.filament/-index-buffer/set-buffer.md

1.75.03.3 KB
Original Source

//filament-android/com.google.android.filament/IndexBuffer/setBuffer

setBuffer

[main]
open fun setBuffer(engine: Engine, buffer: Buffer)

Asynchronously copy-initializes this IndexBuffer from the data provided.

Parameters

main

enginereference to the Engine to associate this IndexBuffer with
buffera CPU-side Buffer with the data used to initialize the IndexBuffer. buffer should contain raw, untyped data that will be interpreted as either 16-bit or 32-bits indices based on the IndexType of this IndexBuffer.

[main]
open fun setBuffer(engine: Engine, buffer: Buffer, destOffsetInBytes: Int, count: Int)

Asynchronously copy-initializes a region of this IndexBuffer from the data provided.

Parameters

main

enginereference to the Engine to associate this IndexBuffer with
buffera CPU-side Buffer with the data used to initialize the IndexBuffer. buffer should contain raw, untyped data that will be interpreted as either 16-bit or 32-bits indices based on the IndexType of this IndexBuffer.
destOffsetInBytesoffset in bytes into the IndexBuffer
countnumber of buffer elements to consume, defaults to buffer.remaining()

[main]
open fun setBuffer(engine: Engine, buffer: Buffer, destOffsetInBytes: Int, count: Int, handler: Any, callback: Runnable)

Asynchronously copy-initializes a region of this IndexBuffer from the data provided.

Parameters

main

enginereference to the Engine to associate this IndexBuffer with
buffera CPU-side Buffer with the data used to initialize the IndexBuffer. buffer should contain raw, untyped data that will be interpreted as either 16-bit or 32-bits indices based on the IndexType of this IndexBuffer.
destOffsetInBytesoffset in bytes into the IndexBuffer
countnumber of buffer elements to consume, defaults to buffer.remaining()
handleran Executor. On Android this can also be a Handler.
callbacka callback executed by handler when bufferis no longer needed.