Jump to content
  • Advertisement
Sign in to follow this  
derek7

I can do = ?

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

given a ID3DXMesh pMesh known and a ID3DXMesh pTemp ;I can do this: pTemp = pMesh;?? or I must do pMesh.CloneMeshFVF(0,pMesh-GetFVF(),device,pTemp);? I find some time just pTemp = pMesh work.

Share this post


Link to post
Share on other sites
Advertisement
It depends if the ID3DXMesh has an operator= in its structure and as far as I know he hasn't have that.

LPD3DXMesh is an pointer to ID3DXMesh, if you use that instead of ID3DXMesh it is possible to do pTemp = pMesh.
If you want to copy the pMesh and put it in pTemp you need to call the clone function.

Share this post


Link to post
Share on other sites
ID3DXMesh is an abstract class, you can't create an instance of it, so I presume your post has a typo, and you actually have pointers.
If that's the case, then the same rules apply for any other pointer. You're not duplicating the object at all, you're just copying the pointer. It will work so long as you don't release the mesh, and anything you do to pMesh will affect pTemp (and vice versa).
If you want to create a copy of the mesh, you want to use ID3DXMesh::CloneMesh() or ID3DXMesh::CloneMeshFVF().

Share this post


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

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!