Kohi Game Engine
kasset_model_serializer.h File Reference

Go to the source code of this file.

Functions

KAPI void * kasset_model_serialize (const kasset_model *asset, u32 exporter_type, u8 exporter_version, 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_model_deserialize (u64 size, const void *block, kasset_model *out_asset)
 Attempts to deserialize the given block of memory into an model asset. More...
 

Function Documentation

◆ kasset_model_deserialize()

KAPI b8 kasset_model_deserialize ( u64  size,
const void *  block,
kasset_model out_asset 
)

Attempts to deserialize the given block of memory into an model 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_model_serialize()

KAPI void* kasset_model_serialize ( const kasset_model asset,
u32  exporter_type,
u8  exporter_version,
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.
exporter_typeSpecifies the type of the exporter for debugging purposes.
exporter_versionSpecifies the version of the exporter for debugging purposes.
Returns
A block of memory containing the serialized asset on success; 0 on failure.