docs/android/dokka/filament-android/com.google.android.filament/-index-buffer/set-buffer.md
//filament-android/com.google.android.filament/IndexBuffer/setBuffer
[main]
open fun setBuffer(engine: Engine, buffer: Buffer)
Asynchronously copy-initializes this IndexBuffer from the data provided.
main
| engine | reference to the Engine to associate this IndexBuffer with |
| buffer | a 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.
main
| engine | reference to the Engine to associate this IndexBuffer with |
| buffer | a 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. |
| destOffsetInBytes | offset in bytes into the IndexBuffer |
| count | number 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.
main
| engine | reference to the Engine to associate this IndexBuffer with |
| buffer | a 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. |
| destOffsetInBytes | offset in bytes into the IndexBuffer |
| count | number of buffer elements to consume, defaults to buffer.remaining() |
| handler | an Executor. On Android this can also be a Handler. |
| callback | a callback executed by handler when bufferis no longer needed. |