You've got to be kidding me. Okay, here is a psuedo-code example:
Code:
bool BuildAndSaveTile(dtNavMeshCreateParams *params, string fileName)
{
unsigned char *meshData;
unsigned int meshDataSize;
if (!dtCreateNavMeshData(params, &meshData, &meshDataSize))
return false;
ofstream outFile(fileName.c_str(), ios_flags::binary);
outFile << meshData;
outFile.close();
return true;
}
bool LoadTile(string fileName, const int flags)
{
ifstream inFile(fileName.c_str(), ios_flags::binary);
if (!inFile)
return false;
unsigned char *inData = new unsigned char[FileSize(fileName)];
inFile >> inData;
dtNavMesh::addTile(inData, FileSize(fileName), flags);
return true;
}