I want to load a mesh from an x file (Dwarf.x - from the SDK examples).
Now to the problem:
----------------------------------------
DX9_String.s = "Dwarf.x" + Chr(0) ; File to be loaded
Result.l = D3DXLoadMeshFromX_(@DX9_String,#D3DXMESH_32BIT,D3DDevice,#Null,@*Mesh_ppMaterials,#Null,@Mesh_pNumMaterials,@Mesh_ppMesh) ; Load the X file - seems to work so far
If Result.l <> #D3D_OK: DX9_ErrorMSG(Result,#DX9ErrorSource002): EndIf ; Give Error if loading was not successful
*Mesh_ppMaterials2.S_D3DXMATERIAL ; Define second Pointer of the Typ D3DXMATERIAL
*Mesh_ppMaterials2 = *Mesh_ppMaterials ; Cast first Pointer to second on
*Mesh_ppMaterials2\GetBufferPointer() ; Use GetBufferPointer to get access to the buffer with the material and texture info
-------------------------------------------------
Well - and the last step is not working. It's obvious why - D3DXMATERIAL is a structure - not an interface and the funtion GetBufferPointer seems to be only part of the ID3DXBuffer Interface.
Anyway - my Book tells me to do so and directX examples also do. There it looks like:
D3DXMATERIAL* lpMaterials = (D3DXMATERIAL*)lpMatrialBuffer->GetBufferPointer()
And this seems to work for VC++

Can anybody tell me how this is supose to work or what I have done wrong
