Archived

This topic is now archived and is closed to further replies.

This topic is 5517 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, when I load a D3DXMesh I can get the FVF by making a call to GetFVF(). This call returns a DWORD. Since this is a value it doesn''t make directly sense. Is there a way to transform this information into a more readable form if I check the value in the debugger? Dirk

Share this post


Link to post
Share on other sites
quote:
Original post by DonDickieD

when I load a D3DXMesh I can get the FVF by making a call to GetFVF(). This call returns a DWORD. Since this is a value it doesn''t make directly sense. Is there a way to transform this information into a more readable form if I check the value in the debugger?




What do you mean when you say it "doesn''t make directly sense" ??
The GetFVF() call returns a DWORD value containing a combination of FVF (flexible vertex format) flags. You can then perform a check to, say, determine if the mesh contains a diffuse colour component in it''s FVF...


  
DWORD dwFVF = myMesh->GetFVF();
if(dwFVF & D3DFVF_DIFFUSE)
{
// this mesh''s FVF has a diffuse colour component

}


Is this the information you are after?

Regards,
Sharky

Share this post


Link to post
Share on other sites
First thanx for you help!

This is not directly what I meant.

I am looking forward to something like this:

DWORD myFVF = pMesh->GetFVF();

Is there a way that the debugger shows me all elements that are contained in the format?
I want something like this:
myFVF: D3DFVF_XYZ|D3DFVF_NORMAL|D3DFVF_TEX1|D3DFVF_XYZB1

and not:

myFVF: 274

when I check the variable in the debugger.

Is this possible or do I have to check for all possibilities?

Dirk

Share this post


Link to post
Share on other sites
You could write a debug routine like this:
(assuming you are using VC++ - and i''m using CStrings for brevity... i wouldn''t usually opt for MFC in game programming)


void foo()
{
DWORD myFVF = pMesh->GetFVF();
#ifdef _DEBUG
CString sFVF = GetFVFStringVal(myFVF);
#endif
}

CString GetFVFStringVal(DWORD &dwFVF)
{
CString sRetVal = "";
if(dwFVF & D3DFVF_DIFFUSE)
{
sRetVal += "D3DFVF_DIFFUSE | ";
}

if(dwFVF & (other flags))
{
sRetVal += "(other flags) | ";
}

//trim off the last " |" or just don''t append it in the last check

return sRetVal;
}


So yes, you will have to loop through them, but this way you could get a quick check in string format.

"You call him Dr. Grip, doll!"

Share this post


Link to post
Share on other sites
quote:
Original post by DonDickieD
Hi,

when I load a D3DXMesh I can get the FVF by making a call to GetFVF(). This call returns a DWORD. Since this is a value it doesn''t make directly sense. Is there a way to transform this information into a more readable form if I check the value in the debugger?

Dirk


there is a file called crackdecl.h/cpp (might be prepended with some characters, I don''t recall) used in some of the samples (might be the shader workshop you download from the web) that does what you want.

Good news is that with DX9 you won''t need to do this sort of cracking anymore.

Share this post


Link to post
Share on other sites