PatchMesh.FromX Method

Language:

Loads a patch mesh from an XFileData object.

Definition

Visual Basic Public Shared Function FromX( _
    ByVal xofObjMesh As XFileData, _
    ByVal options As MeshFlags, _
    ByVal device As Device, _
    ByRef materials As ExtendedMaterial, _
    ByRef effects As EffectInstance _
) As PatchMesh
C# public static PatchMesh FromX(
    XFileData xofObjMesh,
    MeshFlags options,
    Device device,
    out ExtendedMaterial materials,
    out EffectInstance effects
);
C++ public:
static PatchMeshFromX(
    XFileDataxofObjMesh,
    MeshFlags options,
    Devicedevice,
    [Out] ExtendedMaterialmaterials,
    [Out] EffectInstanceeffects
);
JScript public static function FromX(
    xofObjMesh : XFileData,
    options : MeshFlags,
    device : Device,
    materials : ExtendedMaterial,
    effects : EffectInstance
) : PatchMesh;

Parameters

xofObjMesh Microsoft.DirectX.Direct3D.XFileData
An XFileData object that represents the file data object to load.
options Microsoft.DirectX.Direct3D.MeshFlags
One or more MeshFlags that specify creation options for the mesh (excepting the Simplify* or Optimize* flags).
device Microsoft.DirectX.Direct3D.Device
The Device object to associate with the mesh.
materials Microsoft.DirectX.Direct3D.ExtendedMaterial[]
Array of ExtendedMaterial structures that contain material information saved in the mesh.
effects Microsoft.DirectX.Direct3D.EffectInstance[]
An array of EffectInstance structures, where each structure contains a set of EffectDefault structures. Each EffectDefault represents an attribute group in the returned mesh. The data in these structures represent a particular instance of state information used to initialize an effect. For more information, see EffectInstance.

Return Value

Microsoft.DirectX.Direct3D.PatchMesh
Returns a PatchMesh object that represents the loaded patch mesh.

Remarks

For mesh files that do not contain effect instance information, default effect instances are generated from the material information in the DirectX (.x) file. The default values of a default effect instance correspond to the members of the Material structure.

The default texture name also is filled in, but is handled differently. The name is Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This contains the string file name for the texture.

Exceptions
InvalidCallException The method call is invalid. For example, a method's parameter might contain an invalid value.
InvalidDataException The data is invalid.
OutOfMemoryException Leave Site Microsoft Direct3D could not allocate sufficient memory to complete the call.


Send comments about this topic to Microsoft. © Microsoft Corporation. All rights reserved.

Feedback? Please provide us with your comments on this topic.
For more help, visit the DirectX Developer Center