-
public class IndexBufferA buffer containing vertex indices into a
VertexBuffer. Indices can be 16 or 32 bit. The buffer itself is a GPU resource, therefore mutating the data can be relatively slow. Typically these buffers are constant. It is possible, and even encouraged, to use a single index buffer for severalRenderables.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classIndexBuffer.Builder
-
Method Summary
Modifier and Type Method Description intgetIndexCount()Returns the size of this IndexBufferin elements.voidsetBuffer(@NonNull() Engine engine, @NonNull() Buffer buffer)Asynchronously copy-initializes this IndexBufferfrom the data provided.voidsetBuffer(@NonNull() Engine engine, @NonNull() Buffer buffer, @IntRange(from = 0) int destOffsetInBytes, @IntRange(from = 0) int count)Asynchronously copy-initializes a region of this IndexBufferfrom the dataprovided.voidsetBuffer(@NonNull() Engine engine, @NonNull() Buffer buffer, @IntRange(from = 0) int destOffsetInBytes, @IntRange(from = 0) int count, @Nullable() Object handler, @Nullable() Runnable callback)Asynchronously copy-initializes a region of this IndexBufferfrom the dataprovided.longgetNativeObject()-
-
Method Detail
-
getIndexCount
@IntRange(from = 0) int getIndexCount()
Returns the size of this
IndexBufferin elements.
-
setBuffer
void setBuffer(@NonNull() Engine engine, @NonNull() Buffer buffer)
Asynchronously copy-initializes this
IndexBufferfrom the data provided.
-
setBuffer
void setBuffer(@NonNull() Engine engine, @NonNull() Buffer buffer, @IntRange(from = 0) int destOffsetInBytes, @IntRange(from = 0) int count)
Asynchronously copy-initializes a region of this
IndexBufferfrom the dataprovided.
-
setBuffer
void setBuffer(@NonNull() Engine engine, @NonNull() Buffer buffer, @IntRange(from = 0) int destOffsetInBytes, @IntRange(from = 0) int count, @Nullable() Object handler, @Nullable() Runnable callback)
Asynchronously copy-initializes a region of this
IndexBufferfrom the dataprovided.- Parameters:
engine- reference to the Engine to associate thisIndexBufferwithbuffer- a CPU-side Buffer with the data used to initialize theIndexBuffer.destOffsetInBytes- offset in bytes into theIndexBuffercount- number of buffer elements to consume, defaults tobuffer.remaining()handler- an Executor.callback- a callback executed byhandlerwhenbufferis no longer needed.
-
getNativeObject
long getNativeObject()
-
-
-
-