PDA

View Full Version : Problems w/ D3DXLoadMeshHierarchyFromX



RenanSPH
06-09-2007, 07:29 PM
Vars im using:
Alloc: ID3DXAllocateHierarchy;
FrameHeirarchy: PD3DXFRAME;
AnimController: ID3DXANIMATIONCONTROLLER;


the procedure:
if FAILED(D3DXLoadMeshHierarchyFromX('bones_all.x', D3DXMESH_MANAGED, g_pd3dDevice, Alloc, nil, FrameHeirarchy, AnimController)) then Exit;


The procedure D3DXLoadMeshHierarchyFromX is returning a FAILED result. What im doing wrong?

I'm 100% sure thats all ok with the X file (i tried to load others too, but still returning false).

Thanks.

Dan
07-09-2007, 03:47 AM
Have you created ID3DXAllocateHierarchy
example:
Alloc := ID3DXAllocateHierarchy.Create;
...
Alloc.Free;

//ID3DXAllocateHierarchy is actually a class in Delphi even though it starts with an I.

Everything else seems fine.

RenanSPH
12-09-2007, 08:07 PM
Hello Dan, thanks for your reply!

I tried alloc:=ID3DXAllocateHierarchy.Create; and alloc.Free; before D3DXLoadMeshHierarchyFromX, but now im get an error in D3DXLoadMeshHierarchyFromX: "Exception EAbstractError in module Meshes.exe at 0000BC57 Abstract Error."

Dan
12-09-2007, 10:45 PM
you should put alloc.Free; after D3DXLoadMeshHierarchyFromX

RenanSPH
13-09-2007, 10:59 AM
Yes, i put Alloc.Free after and alloc.create before, but the D3DXLoadHierarchyFromX is returning that error :/

chronozphere
13-09-2007, 01:54 PM
Have you tried enabling the DirectX Debug runtimes? They are provided with the DX SDK, and they are the key debugging tool for DX Developers. It returns detailed info about what went wrong

NOTE: You are using D3DX routines, so you have to turn D3DX Debugging on. Check the D3DX9.pas header. There you have to enable a compiler directive (by removing a point).

Hope this helps. :)

Setharian
13-09-2007, 03:33 PM
You have to define your own class which inherits from ID3DXAllocateHierarchy and override the 4 virtual abstract methods defined in that class. What to do in those overriden methods is beyond me, never worked with it. Maybe you can read up some documentation on MSDN.

RenanSPH
13-09-2007, 07:06 PM
So i might define my own class? DX Headers dont already have a class for this?

Ok thanks, ill try it.