Click to See Complete Forum and Search --> : Direct3DRM


April 10th, 1999, 08:31 PM
Hi. I'm just getting started in DirectX. The project I'm working on is a regular MFC MDI application with doc/view architecture. In my CDocument derived class, I have a LPDIRECT3DRMMESHBUILDER and a LPDIRECT3DRMTEXTURE object. I overrided CDocument::OnOpenDocument() to open D3D Files (*.x) using the IDirect3DRMMeshBuilder::Load() method. The view then display the mesh builder object. I overrided CDocument::OnSaveDocument() to save the mesh builder object back with a different file name. When I call IDirect3DRMMeshBuilder::Save() and then reopen the file nothing comes up. As far as I know, the mesh builder is not being saved. Here's the code:

BOOL CMeshDoc::OnSaveDocument(LPCTSTR lpszPathName)
{
HRESULT hRes = m_lpMeshBuilder->Save(lpszPathName, D3DRMXOF_BINARY, D3DRMXOFSAVE_ALL);
if (FAILED(hRes))
return FALSE;

return TRUE;
}

Can someone tell my what's wrong and if I'm saving and loading the mesh the right way. Code samples will help.

Thanks.