Loading an X File (Legacy) (Direct3D 9)
Use the following procedure in legacy applications to load a .x file.
- Use the DirectXFileCreate function to create an IDirectXFile object.
- If templates are present in the DirectX file that you will load, use the IDirectXFile::RegisterTemplates method to register those templates.
- Use the IDirectXFile::CreateEnumObject method to create an IDirectXFileEnumObject enumerator object.
- Loop through the objects in the file. For each object, perform the following steps.
- Use the IDirectXFileEnumObject::GetNextDataObject method to retrieve each IDirectXFileData object.
- Use the IDirectXFileData::GetType method to retrieve the data's type.
- Load the data using the IDirectXFileData::GetData method.
- If the object has optional members, retrieve the optional members by calling the IDirectXFileData::GetNextObject method.
- Release the IDirectXFileData object.
- Release the IDirectXFileEnumObject object.
- Release the IDirectXFile object.
Related topics