Asset Decoder API

Functions for decompressing streaming data.

Functions

UmbraExternalAssetLoader* UmbraExternalAssetLoaderCreate(UmbraAllocator* allocator)
Create an external asset loader.
void UmbraExternalAssetLoaderDestroy(UmbraExternalAssetLoader* loader)
Destroy an external asset loader.
UmbraBool UmbraExternalMeshLoadGetData(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedMeshLoad, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)
Decode a serialized mesh.
UmbraBool UmbraExternalMeshStreamSetSourceBuffer(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedMeshLoad)
Set up a streamed mesh decode's input.
UmbraBool UmbraExternalMeshStreamSetDestinationBuffers(UmbraExternalAssetLoader* loader, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)
Set up a streamed mesh decode's outputs.
UmbraBool UmbraExternalMeshStreamDone(UmbraExternalAssetLoader* loader)
Check if a streaming mesh decode has completed.
UmbraBool UmbraExternalMeshStreamNext(UmbraExternalAssetLoader* loader, uint32_t* numVertices, uint32_t* numIndices)
Decode the next part of a mesh.
UmbraBool UmbraExternalTextureLoadGetData(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedTextureLoad, const UmbraByteBuffer* buffer)
Decode a texture.

Function details

UmbraExternalAssetLoader* UmbraExternalAssetLoaderCreate(UmbraAllocator* allocator)

Create an external asset loader.

Parameters
allocator in The allocator that the loader uses to allocate memory. Can be NULL.
Returns A new external asset loader.

void UmbraExternalAssetLoaderDestroy(UmbraExternalAssetLoader* loader)

Destroy an external asset loader.

Parameters
loader in The external asset loader.

UmbraBool UmbraExternalMeshLoadGetData(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedMeshLoad, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)

Decode a serialized mesh.

Parameters
loader in The external asset loader.
serializedMeshLoad in The serialized mesh load.
vertexBuffers out The vertex buffers.
indexBuffer out The index buffer.
Returns Non-zero on success. Fails if the buffers don't meet the conditions listed under UmbraMeshLoadGetData.

UmbraBool UmbraExternalMeshStreamSetSourceBuffer(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedMeshLoad)

Set up a streamed mesh decode's input.

Parameters
loader in The external asset loader.
serializedMeshLoad in The serialized mesh load.
Returns Non-zero on success, zero on failure.

UmbraBool UmbraExternalMeshStreamSetDestinationBuffers(UmbraExternalAssetLoader* loader, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)

Set up a streamed mesh decode's outputs.

Parameters
loader in The external asset loader.
vertexBuffers out The vertex buffers.
indexBuffer out The index buffer.
Returns Non-zero on success. Fails and returns zero if the buffers don't meet the conditions listed under UmbraMeshLoadGetData.

UmbraBool UmbraExternalMeshStreamDone(UmbraExternalAssetLoader* loader)

Check if a streaming mesh decode has completed.

Parameters
loader in The external asset loader.
Returns Non-zero if the decode completed, zero if there is still data to decode.

UmbraBool UmbraExternalMeshStreamNext(UmbraExternalAssetLoader* loader, uint32_t* numVertices, uint32_t* numIndices)

Decode the next part of a mesh.

Parameters
loader in The external asset loader.
numVertices out The number of vertices decoded with this function call.
numIndices out The number of indices decoded with this function call.
Returns Non-zero if the chunk was successfully decoded.

UmbraBool UmbraExternalTextureLoadGetData(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedTextureLoad, const UmbraByteBuffer* buffer)

Decode a texture.

Parameters
loader in The external asset loader.
serializedTextureLoad in The serialized texture load.
buffer out The output buffer.
Returns Non-zero on success.