Jump to content
  • Advertisement
Sign in to follow this  
quang

Error in almost X file loader and animation

This topic is 4132 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

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); };

Share this post


Link to post
Share on other sites
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.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!