-
public class BufferObjectA generic GPU buffer containing data. Usage of this BufferObject is optional. For simple use cases it is not necessary. It is useful only when you need to share data between multiple VertexBuffer instances. It also allows you to efficiently swap-out the buffers in VertexBuffer. NOTE: For now this is only used for vertex data, but in the future we may use it for other things (e.g. compute).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classBufferObject.Builder
-
Method Summary
Modifier and Type Method Description intgetByteCount()Returns the size of this BufferObjectin elements.voidsetBuffer(@NonNull() Engine engine, @NonNull() Buffer buffer)Asynchronously copy-initializes this BufferObjectfrom 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 BufferObjectfrom 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 BufferObjectfrom the dataprovided.longgetNativeObject()-
-
Method Detail
-
getByteCount
@IntRange(from = 0) int getByteCount()
Returns the size of this
BufferObjectin elements.
-
setBuffer
void setBuffer(@NonNull() Engine engine, @NonNull() Buffer buffer)
Asynchronously copy-initializes this
BufferObjectfrom 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
BufferObjectfrom 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
BufferObjectfrom the dataprovided.- Parameters:
engine- reference to the Engine to associate thisBufferObjectwithbuffer- a CPU-side Buffer with the data used to initialize theBufferObject.destOffsetInBytes- offset in bytes into theBufferObjectcount- number of bytes to consume, defaults tobuffer.remaining()handler- an Executor.callback- a callback executed byhandlerwhenbufferis no longer needed.
-
getNativeObject
long getNativeObject()
-
-
-
-