Below is code I currently have for calling D3DXLoadMeshFromX which doesn't
work.
sprintf ( xpath, "Data//Xfiles//%s", xname);
if( FAILED( D3DXLoadMeshFromX( (LPCWSTR) xpath, D3DXMESH_SYSTEMMEM,
pCB->pGE2_pd3dDevice, NULL,
&pD3DXMtrlBuffer, NULL, &numMaterials,
&pMesh ) ) )
If I replace '(LPCWSTR) xpath' with 'L "Data//Xfiles//model.x"' it works.
Ofcourse I want to use the vairable xpath so I can load a variable file.
What can I do to fix this so I am passing an LPCWSTR string to the
D3DXLoadMeshFromX call?