Jump to content
  • Advertisement
Sign in to follow this  
jwbaumgartner

CloneMeshFVF() problems.

This topic is 4355 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->Release();
			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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!