• Advertisement
Sign in to follow this  

trouble filling the mesh container

This topic is 3492 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi im tring to load the tiny.x file. in the CreateMeshContainer(LPCTSTR Name, const D3DXMESHDATA *pMeshData, const D3DXMATERIAL *pMaterials, const D3DXEFFECTINSTANCE *pEffectInstances, DWORD NumMaterials, const DWORD *pAdjacency, LPD3DXSKININFO pSkinInfo, LPD3DXMESHCONTAINER *ppMeshContainer)" call back function i fill in the mesh container data and to local mesh container local variable and assign it to the ppMeshContainer in the following way *ppMeshContainer = (D3DXMESHCONTAINER*)pMeshContainer; when i debug i see that the correct values have been passed on to *ppMeshContainer i try to access this info from a different location after i filled in this data but all i recive is null. any reason for this does directX release this data ??? i tried to access the data like this void TD3DMultiMesh::ProcessSkinFrame(LPD3DXFRAME pFrame) { D3DXFRAME_MATRIX * pMtxFrame = (D3DXFRAME_MATRIX*)pFrame; D3DXMESHCONTAINER_DERIVED * pContainer = (D3DXMESHCONTAINER_DERIVED*)pFrame->pMeshContainer; TD3DMesh * pMesh ; ..... pFrame->pMeshContainer this just returns NULL. but the pFrame does pass in a valid frame. can any one help me on this

Share this post


Link to post
Share on other sites
Advertisement
DirectX doesn't release the data. Your code destroys it. Even then, the value of the pointer will not be NULL, unless you set it to NULL.

You may have several problems. One problem may be how you define D3DXMESHCONTAINER_DERIVED and the other how you define D3DXFRAME_MATRIX. Those classes must be based on D3DXMESHCONTAINER and D3DXFRAME correctly.

Post your code where you define D3DXMESHCONTAINER_DERIVED and D3DXFRAME_MATRIX, and the code for your CreateMeshContainer function.

They should look something like:
class D3DXFRAME_MATRIX : public D3DXFRAME {...}
class D3DXMESHCONTAINER_DERIVED : public D3DXMESHCONTAINER {...}

Also, in your CreateMeshContainer function, do you have:

D3DXMESHCONTAINER_DERIVED * pMeshContainer = new D3DXMESHCONTAINER_DERIVED();
ZeroMemory(pMeshContainer , sizeof(D3DXMESHCONTAINER_DERIVED));
...
*ppMeshContainer = (D3DXMESHCONTAINER*)pMeshContainer;

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement