Error in almost X file loader and animation

Started by
1 comment, last by TohaTalib 17 years, 2 months ago
i found many code about load X file and animate, but when i compile them they alway have the same error is: error C2259: 'CAllocateHierarchy' : cannot instantiate abstract class i don't know why, so anybody help me... Note: the code is class CAllocateHierarchy: public ID3DXAllocateHierarchy { public: STDMETHOD(CreateFrame)(THIS_ LPCTSTR Name, LPD3DXFRAME *ppNewFrame); STDMETHOD(CreateMeshContainer)(THIS_ LPCTSTR Name, LPD3DXMESHDATA pMeshData, LPD3DXMATERIAL pMaterials, LPD3DXEFFECTINSTANCE pEffectInstances, DWORD NumMaterials, DWORD *pAdjacency, LPD3DXSKININFO pSkinInfo, LPD3DXMESHCONTAINER *ppNewMeshContainer); STDMETHOD(DestroyFrame)(THIS_ LPD3DXFRAME pFrameToFree); STDMETHOD(DestroyMeshContainer)(THIS_ LPD3DXMESHCONTAINER pMeshContainerBase); };
^^
Advertisement
I dont know much about animation in DX but. . . The ID3DXAllocateHierarchy is an interface or a totally abstract class with no variables(it has a bunch of pure virtual functions), and abstract classes and interfaces cannot be instantiated(you cannot create objects of these kinds). I see you're deriving ID3DXAllocateHierarchy but I dont know if you have already defined the body of the functions of this CAllocateHierarchy class. You must build the body of all these functions from ID3DXAllocateHierarchy. Please show more of your code or explain more about it.
.
Try using IDrectXFile interface to upload any data - is is more effective when you'll build your own .X parser.

This topic is closed to new replies.

Advertisement