• Advertisement
Sign in to follow this  

newbie question, .x file

This topic is 4145 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 sorry, it's probably a newbie question, but here I try to build something, and there is a error that I can't resolve... it's a simple program that load a .X file...I have DirectX SDK August 2006 and visual c++ express here is the line : if (FAILED(D3DXLoadSkinMeshFromXof(pDataObj, 0, g_pD3DDevice, &Adjacency, &MaterialBuffer, NULL, &Mesh->m_NumMaterials, &Mesh->m_SkinInfo, &Mesh->m_Mesh))) { delete Mesh; return; } and here is the variable : IDirectXFileData* pDataObj and here is the mistake I get : error C2664: 'D3DXLoadSkinMeshFromXof' : cannot convert parameter 1 from 'IDirectXFileData *' to 'LPD3DXFILEDATA' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast what I don't understand is that i've read in the SDK doc that LPD3DXFILEDATA is a pointer to a IDirectXFileData...... so doesn,t that mean that IDirectXFileData * is the same thing as LPD3DXFILEDATA ??? thanks for your answer

Share this post


Link to post
Share on other sites
Advertisement
IDirectXFileData* pDataObj


should be

ID3DXFileData* pDataObj


See this thread for more info, specifically this from Dave Hunt:

Quote:
IDirectXFileData has been deprecated, as have all of the IDirectXFile* interfaces. They have all been replaced with ID3DXFile* interfaces.


[Edited by - Will F on October 17, 2006 11:27:20 AM]

Share this post


Link to post
Share on other sites
thanks for the answer :-)

yeah I checked the link, and me too it's from that book (Programming RPG with DirectX 2nd) and me too it's the code from the book. (is the author of the book have a forum? cause the web address he give in his book is only for his first ed :-S)

I replaced IDirectXFileData* pDataObj with ID3DXFileData* pDataObj and now there is the error :

error C2664: 'IDirectXFileEnumObject::GetNextDataObject' : cannot convert parameter 1 from 'ID3DXFileData **' to 'LPDIRECTXFILEDATA *'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

I've replaced : IDirectXFile* pDXFile = NULL;
IDirectXFileEnumObject* pDXEnum = NULL;
ID3DXFileData* pDXData = NULL;

by ID3DXFile* pDXFile = NULL;
ID3DXFileEnumObject* pDXEnum = NULL;
ID3DXFileData* pDXData = NULL;

but yikes doesn't work

is there any place where I could find a SIMPLE example that load a .X file... like the one in that book BUT working lol?


Share this post


Link to post
Share on other sites
oki

i,ve replaced the SDK with the one in the book, and it worked, but now I have a linker error : error LNK2019: unresolved external symbol _DirectXFileCreate@4 referenced in function "struct sFrame * __cdecl ParseXFile(char *)" (?ParseXFile@@YAPAUsFrame@@PAD@Z)

why is that?

Share this post


Link to post
Share on other sites
You used the function ParseXFile() while you haven't defined it yet.

-Stenny

Share this post


Link to post
Share on other sites
it is defined :-S....

I even copy-paste the book code into my project.... the project from the book build perfectly, but not mine

Share this post


Link to post
Share on other sites
I know, I'm struggling through the book too at the moment. Are you sure you have set up the right includes?

Share this post


Link to post
Share on other sites
yeah, that book and directX is an everyday struggle LOL

well, I included everything the guy said in his file.... winmm.lib, d3d9.lib, d3dx9.lib and dxguid.lib

but him I see that in his project he have odbc32.lib odbccp32.lib included too....

and nope it still doesn't work....

ParseXFile() is a function he defined himself.... and it's defined in my project too (it's copy and paste.... lol)

Share this post


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

  • Advertisement