?/TD> |
Microsoft DirectX 9.0 |
Loads a skin mesh from a Microsoft?DirectX?.x file data object.
Syntax
HRESULT D3DXLoadSkinMeshFromXof(
LPDIRECTXFILEDATA pXofObjMesh, DWORD Options, LPDIRECT3DDEVICE9 pDevice, LPD3DXBUFFER* ppAdjacency, LPD3DXBUFFER* ppMaterials, LPD3DXBUFFER* ppEffectInstances, DWORD* pMatOut, LPD3DXSKININFO* ppSkinInfo, LPD3DXMESH* ppMesh );
Parameters
- pXofObjMesh
- [in] Pointer to an IDirectXFileData interface, representing the DirectX file data object to load.
- Options
- [in] Combination of one or more flags, from the D3DXMESH enumeration, specifying creation options for the mesh.
- pDevice
- [in] Pointer to an IDirect3DDevice9 interface, the device object associated with the mesh.
- ppAdjacency
- [out] Address of a pointer to an ID3DXBuffer interface. When this method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh.
- ppMaterials
- [out] Address of a pointer to an ID3DXBuffer interface. When the method returns, this parameter is filled with an array of D3DXMATERIAL structures.
- ppEffectInstances
- [out] Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See D3DXEFFECTINSTANCE. For more information about accessing the buffer, see ID3DXBuffer.
- pMatOut
- [out] Pointer to the number of D3DXMATERIAL structures in the ppMaterials array, when the method returns.
- ppSkinInfo
- [out] Address of a pointer to an ID3DXSkinInfo interface, which represents the skinning information.
- ppMesh
- [out] Address of a pointer to an ID3DXMesh interface, which represents the loaded mesh.
Return Value
If the function succeeds, the return value is D3D_OK.
If the function fails, the return value can be one of the following values.
D3DERR_INVALIDCALL The method call is invalid. For example, a method's parameter may have an invalid value. D3DXERR_INVALIDDATA The data is invalid. E_OUTOFMEMORY Microsoft Direct3D?could not allocate sufficient memory to complete the call.
Remarks
This method takes a pointer to an internal object in the .x file, enabling you to load the frame hierarchy.
For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the D3DMATERIAL9 structure.The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.
Calling D3DXLoadMeshFromXof on an IDirectXFileData interface obtained using IDirectXFileDataReference::Resolve will fail because of a know problem handling references.
Function Information
Header d3dx9mesh.h Import library d3dx9.lib Minimum operating systems Windows 98
See Also
D3DXEFFECTDEFAULT, D3DXEFFECTINSTANCE