D3D9学习笔记(八) .x file

简介:

8.1 load

  1. Use the DirectXFileCreate function to create an IDirectXFile object.
  2. If templates are present in the DirectX file that you will load, use the IDirectXFile::RegisterTemplates method to register those templates.
  3. Use the IDirectXFile::CreateEnumObject method to create an IDirectXFileEnumObject enumerator object.
  4. Loop through the objects in the file. For each object, perform the following steps.
    1. Use the IDirectXFileEnumObject::GetNextDataObject method to retrieve each IDirectXFileData object.
    2. Use the IDirectXFileData::GetType method to retrieve the data's type.
    3. Load the data using the IDirectXFileData::GetData method.
    4. If the object has optional members, retrieve the optional members by calling the IDirectXFileData::GetNextObject method.
    5. Release the IDirectXFileData object.
  5. Release the IDirectXFileEnumObject object.
  6. Release the IDirectXFile object.

8.2 save

  1. Use the DirectXFileCreate function to create an IDirectXFile object.
  2. Use the IDirectXFile::RegisterTemplates method to inform the DirectX file system about any templates that you will use.
  3. Use the IDirectXFile::CreateSaveObject method to create an IDirectXFileSaveObject object.
  4. Use the IDirectXFileSaveObject::SaveTemplates method to save templates, if desired.
  5. Loop through the objects to save. For each top-level object, perform the following steps.

o    Use the IDirectXFileSaveObject::CreateDataObject method to create an IDirectXFileData object as a top-level object in the file. If the top-level data object has optional child objects, add them to the object by using the appropriate method from the next step.

o    Each IDirectXFileData object can have optional child objects if its template allows it. The child objects can be any of the three types of objects: IDirectXFileData, IDirectXFileDataReference, or IDirectXFileBinary. Loop through the objects you need to save, adding each optional child member to the object list in the manner appropriate to its type, as illustrated in the following steps. Then, if the object type is Data, call the IDirectXFileSaveObject::CreateDataObject method to create an IDirectXFileData object, and then call the IDirectXFileData::AddDataObject method to add it as a child of the object. If the object type is Data Reference, call the IDirectXFileData::AddDataReference method to create and add the data reference object as a child of the object. Or, if the object type is Binary, call the IDirectXFileData::AddBinaryObject method to create and add the binary object as a child of the object.

o    Call the IDirectXFileSaveObject::SaveData method to save the data object and its children.

o    Release the IDirectXFileData object.

  1. Release the IDirectXFileSaveObject object.
  2. Release the IDirectXFile object.
目录
相关文章
|
C#
C# File、FileInfo、Directory、DirectoryInfo
本文主要介绍文件类、文件信息类、目录类、目录信息类的常用属性和方法
63 0
zipfile.BadZipFile: File is not a zip file|4-21
zipfile.BadZipFile: File is not a zip file|4-21
zipfile.BadZipFile: File is not a zip file|4-21
|
8月前
|
Shell
adb: error: cannot create file/directory ‘d:/1.png‘: No such file or directory
adb: error: cannot create file/directory ‘d:/1.png‘: No such file or directory
133 0
|
8月前
|
C#
C# File.Copy介绍
C# File.Copy介绍
指定的 filePath 文件不存在
指定的 filePath 文件不存在
59 2
objdump: ‘1443.14.0)‘: No such file or directory
objdump: ‘1443.14.0)‘: No such file or directory
114 0
No such file or directory
No such file or directory
325 0
No such file or directory
FILE
FILE
124 0
|
Java Linux
小师妹学JavaIO之:File copy和File filter
小师妹学JavaIO之:File copy和File filter
|
Python
6.2 file 写文件
#!/usr/bin/env python # -*- coding:utf-8 -*- #@Time      :2017/10/27 22:15 #@Author    :zhouyuyao #@File      :file_write.
696 0