2

I have been working on an incredibly simple 3D game in C++ / DirectX 9.

I quickly modelled a mesh in Blender, and exported it to the .X format. When I use

D3DXLoadMeshFromX("mesh.x", D3DXMESH_MANAGED, NULL, NULL, &materialBuffer, NULL,
&materialCount, &mesh);

The HRESULT returns -2005531760.

I looked this up with the DirectX Error Lookup tool, and it tells me it's a parse error. I have no idea what could have caused this - mesh.x exists in the same directory...

1 Answers1

1

It may be that the exporter Blender is using is flawled / not compatible with the directx loading library. Try using a different exporter or exporting as another format and then converting to X.

denidare
  • 474
  • 1
  • 4
  • 16
  • Thanks, it turned out Blender wasn't working. I exported it as a .3ds file and converted that to a .x file. –  Aug 10 '13 at 12:43
  • @bojoradarial Search for a working X plugin for blender, or try to export as obj (that's quite plain) and then convert. Also remeber that you have to load the textures separately from the mesh in the code. – denidare Aug 10 '13 at 13:30