Kohi Game Engine
kasset_static_mesh_serializer.h File Reference

Go to the source code of this file.

Functions

KAPI void * kasset_static_mesh_serialize (const kasset_static_mesh *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_static_mesh_deserialize (u64 size, const void *block, kasset_static_mesh *out_asset)
 Attempts to deserialize the given block of memory into an static_mesh asset. More...
 

Function Documentation

◆ kasset_static_mesh_deserialize()

KAPI b8 kasset_static_mesh_deserialize ( u64  size,
const void *  block,
kasset_static_mesh out_asset 
)

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

KAPI void* kasset_static_mesh_serialize ( const kasset_static_mesh 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.