Microsoft DirectX 8.1 (Visual Basic)

Loading an X File

Use the following procedure to load an .x file.

  1. Use the DirectX8.DirectXFileCreate method to create a DirectXFile object.
  2. If templates are present in the Microsoft® DirectX® file that you will load, use the DirectXFile.RegisterTemplates method to register those templates.
  3. Use the DirectXFile.CreateEnumObject method to create a DirectXFileEnum enumerator object.
  4. Loop through the objects in the file. For each object, perform the following steps.
    1. Use the DirectXFileEnum.GetNextDataObject method to retrieve each DirectXFileData object.
    2. Use the DirectXFileData.GetType method to retrieve the data's type.
    3. Load the data using the DirectXFileData.GetData method.
    4. If the object has optional members, retrieve the optional members by calling the DirectXFileData.GetNextObject method.
    5. Set the DirectXFileData object variable to Nothing.
  5. Set the DirectXFileEnum object variable to Nothing.
  6. Set the DirectXFile object variable to Nothing.