Decoder API

Functions

UmbraExternalAssetLoader* UmbraExternalAssetLoaderCreate(UmbraAllocator* allocator)
Creates a external asset loader object.
void UmbraExternalAssetLoaderDestroy(UmbraExternalAssetLoader* loader)
Destroys the external asset loader object.
UmbraBool UmbraExternalMeshLoadGetData(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedMeshLoad, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)
Decodes the mesh into the destination vertex and index buffers.
UmbraBool UmbraExternalMeshStreamSetSourceBuffer(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedMeshLoad)
Sets and verifies the source buffers used to run the streaming mesh decoder.
UmbraBool UmbraExternalMeshStreamSetDestinationBuffers(UmbraExternalAssetLoader* loader, const UmbraElementBuffer vertexBuffers[UmbraVertexAttributeCount], const UmbraElementBuffer* indexBuffer)
Sets and verifies the destination buffers used to run the streaming mesh decoder.
UmbraBool UmbraExternalMeshStreamDone(UmbraExternalAssetLoader* loader)
Returns if the streaming mesh decoder is done.
UmbraBool UmbraExternalMeshStreamNext(UmbraExternalAssetLoader* loader, uint32_t* numVertices, uint32_t* numIndices)
Decodes the next mesh part of the stream to the previously set destination buffers.
UmbraBool UmbraExternalTextureLoadGetData(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedTextureLoad, const UmbraByteBuffer* buffer)
Decodes the texture into the destination buffer.

Function details

UmbraExternalAssetLoader* UmbraExternalAssetLoaderCreate(UmbraAllocator* allocator)

Creates a external asset loader object.

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

void UmbraExternalAssetLoaderDestroy(UmbraExternalAssetLoader* loader)

Destroys the external asset loader object.

Parameters
loader in The external asset loader object to destroy.

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

Decodes the mesh into the destination vertex and index buffers.

Parameters
loader in The external asset loader used for decoding.
serializedMeshLoad in The serialized asset load whose mesh to decode.
vertexBuffers out Where to decode the vertex attributes of the mesh.
indexBuffer out Where to decode the index buffer of the mesh.
Returns true if the mesh was successfully decoded into vertex and index buffers, false otherwise.

UmbraBool UmbraExternalMeshStreamSetSourceBuffer(UmbraExternalAssetLoader* loader, UmbraByteBuffer serializedMeshLoad)

Sets and verifies the source buffers used to run the streaming mesh decoder.

Parameters
loader in The external asset loader used for decoding.
serializedMeshLoad in The serialized mesh load where the mesh is loaded from.
Returns true if the mesh load was set up correctly, false otherwise.

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

Sets and verifies the destination buffers used to run the streaming mesh decoder.

Parameters
loader in The external asset loader whose destination buffers are modified.
vertexBuffers out Where to decode the vertex attributes of the mesh.
indexBuffer out Where to decode the index buffer of the mesh.
Returns true if the destination buffers were set up correctly, false otherwise.

UmbraBool UmbraExternalMeshStreamDone(UmbraExternalAssetLoader* loader)

Returns if the streaming mesh decoder is done.

Parameters
loader in The external mesh loader whose completion to query.
Returns true if the decoder is done, false otherwise.

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

Decodes the next mesh part of the stream to the previously set destination buffers.

Parameters
loader in The external mesh loader whose mesh part to decode.
numVertices out Where to store the number of decoded vertices.
numIndices out Where to store the number of decoded indices.
Returns true if the mesh part was decoded successfully, false otherwise.

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

Decodes the texture into the destination buffer.

Parameters
loader in The external asset loader used for decoding.
serializedTextureLoad in The serialized asset load whose texture to decode.
buffer out Where to decode the texture.
Returns true if the texture was decoded successfully, false otherwise.