Skip to main content
GameDev.net gamedev.net
🔒 Locked

CloneMeshFVF() problems

Started by VanillaSnake21 Mar 7, 2007 at 10:43 PM 3 replies 650+ views
Original Post
VanillaSnake21
VanillaSnake21
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.
You didn't come into this world. You came out of it, like a wave from the ocean. You are not a stranger here. -Alan Watts
VanillaSnake21
VanillaSnake21
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
You didn't come into this world. You came out of it, like a wave from the ocean. You are not a stranger here. -Alan Watts
Sc4Freak
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.
VanillaSnake21
VanillaSnake21
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()
You didn't come into this world. You came out of it, like a wave from the ocean. You are not a stranger here. -Alan Watts

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.