Original Post
I'm wondering how to load x files from models that I create in Blender, Blender only exports text x files. I tried an example loading an x file and displaying it, and the x file was a binary x file, it worked. But when I used the text x files I got from blender, I got an error in loading. If anyone can tell me how to load the text format x files, please tell me. (using VC++ .net 2005 and dx9)
// globals:
IDirect3DDevice9* Device = 0;
ID3DXMesh* Mesh = 0;
// within a function:
ID3DXBuffer* adjBuffer = 0;
ID3DXBuffer* mtrlBuffer = 0;
DWORD numMtrls = 0;
hr = D3DXLoadMeshFromX(
"file.x",
D3DXMESH_MANAGED,
Device,
&adjBuffer,
&mtrlBuffer,
0,
&numMtrls,
&Mesh);
if(FAILED(hr))
{
::MessageBox(0, "Mesh Loading Failed", 0, 0);
return false;
}