Jump to content
  • Advertisement
Sign in to follow this  
VanillaSnake21

CloneMeshFVF() problems

This topic is 4218 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, I'm trying to make the CloneMeshFVF() function work by passing in a DWORD variable, and not a "#define" variable, and if I do that It always fails. For example
DWORD mesh_FVF =  D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1 | D3DFVF_NORMAL;
...
mesh->CloneMeshFVF(D3DXMESH_SYSTEMMEM, mesh_FVF, localDevice, &clonedMesh);
but if I have something like #define MESHFVF (D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_TEX1 | D3DFVF_NORMAL), and pass that into the function it's fine. Please help, Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Sc4Freak
...what exactly is the error you're getting?


I'm not getting any error, but I'm testign the funtion with FAILED(), and it fails everytime I pass in a variable DWORD

Share this post


Link to post
Share on other sites
Exactly, so what's the HRESULT returned?

Anyway, I don't see why that should cause an error. I suspect that you're somehow erroneously manipulating the value of mesh_FVF somewhere, before passing it to CloneMeshFVF. Try setting the value of mesh_FVF just before you call CloneMeshFVF, and tell us what happens.

Share this post


Link to post
Share on other sites
Quote:
Original post by Sc4Freak
Exactly, so what's the HRESULT returned?

Anyway, I don't see why that should cause an error. I suspect that you're somehow erroneously manipulating the value of mesh_FVF somewhere, before passing it to CloneMeshFVF. Try setting the value of mesh_FVF just before you call CloneMeshFVF, and tell us what happens.


Thanks :) yeah, that was it, I set it right before the CloneMeshFVF() and it worked fine, but why won't it work when I try to initialize it in the constructor? I am sure that I'm not manipulating anywhere before the call to clone (I searched the document for mesh_FVF, and it only found it in two places, first when I declare it, and second inside 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.

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!