ID3DXFileData::GetType Method -problem Solved

Started by
-1 comments, last by Stevieboy 19 years, 3 months ago
Hi, I'm trying to get an xfile template type in English, such as TID_D3DRMFrame. When using ID3DXFileData::GetType the return is; GUID tpType; //xfile data object p_XFileData->GetType( &pType ); //this is the result printed to a text file. pType.Data1 = 1031973709 pType.Data2 = 25306 pType.Data3 = 4559 pType.Data4 = «9 //should be an 8 byte char array This should be a material, so I was hoping to get TID_D3DRMaterial, instead I got that. Does any one know what is happening here? Also what is the difference between ID3DXFileData::GetType and ID3DXFileData::GetId. Also while I'm asking, when trying to make an xfile loader (for just loading xfiles, not 3ds files or anything), how do you register the templates, do you still use your xfile object as in; pXFile->RegisterTemplates((LPVOID)D3DRM_XTEMPLATES, 3278*sizeof(BYTE)); Or do you also have to register each one by hand as a string or something, in the docs the example is;

//from the docs (summer 2004 update)

//Edit sorry the code won't fit in the window, but it's the code sample at
//the bottom of;
//Directx Graphics / Reference / XFile Referance / Interfaces / ID3DXFile / RegisterTempltes

if ( FAILED 
        (hr = pD3DXFile->RegisterTemplates( 
            (LPVOID)XSKINEXP_TEMPLATES,
            sizeof( XSKINEXP_TEMPLATES ) - 1 ) ) )
    goto End;
Thanks for any help with this Edit ok I discovered in the debugger that I do get the right type returned, the debugger lists it as pType{3D82AB4D-62DA-11cf-AB39-0020AF71E433} which is the right type, but I still want to get it as TID_D3DRMaterial, so I can check what the type is for loading, unless theres another way? Thanks solved I must have been having problems with including rmxfguid.h in the right place. To check the template i just used if(pType == TID_D3DRMMaterial) etc and it seems to work. [Edited by - Stevieboy on January 3, 2005 7:52:36 PM]

This topic is closed to new replies.

Advertisement