Kohi Game Engine
kasset_audio_serializer.h File Reference

Go to the source code of this file.

Functions

KAPI void * kasset_audio_serialize (const kasset_audio *asset, u64 *out_size)
 Attempts to serialize the asset into a binary blob. NOTE: allocates memory that should be freed by the caller. More...
 
KAPI b8 kasset_audio_deserialize (u64 size, const void *block, kasset_audio *out_asset)
 Attempts to deserialize the given block of memory into an audio asset. More...
 

Function Documentation

◆ kasset_audio_deserialize()

KAPI b8 kasset_audio_deserialize ( u64  size,
const void *  block,
kasset_audio out_asset 
)

Attempts to deserialize the given block of memory into an audio asset.

Parameters
sizeThe size of the serialized block in bytes. Required.
blockA constant pointer to the block of memory to deserialize. Required.
out_assetA pointer to the asset to deserialize to. Required.
Returns
True on success; otherwise false.

◆ kasset_audio_serialize()

KAPI void* kasset_audio_serialize ( const kasset_audio asset,
u64 out_size 
)

Attempts to serialize the asset into a binary blob. NOTE: allocates memory that should be freed by the caller.

Parameters
assetA constant pointer to the asset to be serialized. Required.
out_sizeA pointer to hold the size of the serialized block of memory. Required.
Returns
A block of memory containing the serialized asset on success; 0 on failure.