Sign in to follow this  
VanillaSnake21

CloneMeshFVF() problems

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this