• Advertisement
Sign in to follow this  

CloneMeshFVF() problems.

This topic is 4230 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

Okay, I am loading a .X Model with
FAILED( D3DXLoadMeshFromX( szFile, D3DXMESH_SYSTEMMEM, pDevice, NULL, &pMaterialBuffer, NULL, &m_dwNumMaterials, &m_pMesh )

When I check to see if this model has vertex normals, I am doing this:
                // Check to see if we need vertex normals.
		if (!(m_pMesh->GetFVF() & D3DFVF_NORMAL))
			ID3DXMesh *pTempMesh = 0;
			m_pMesh->CloneMeshFVF(D3DXMESH_MANAGED, m_pMesh->GetFVF() | D3DFVF_NORMAL, pDevice, &pTempMesh);

			m_pMesh = pTempMesh;

		// Compute normals
		D3DXComputeNormals( m_pMesh, 0 );

And for some wierd reason, after I added the vertex normal compution, it crashes when it tries to render the model when it executes
m_pMesh->DrawSubset( i );

Any help would be much appreciated. Thanks.

Share this post

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

  • Advertisement