Microsoft DirectX 8.1 (C++)
Loading an X File
Use the following procedure to load an .x file.
Use the
DirectXFileCreate
function to create an
IDirectXFile
object.
If templates are present in the Microsoft® 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.