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.
目录
相关文章
windbg分析 IRQL_NOT_LESS_OR_EQUAL 蓝屏问题
本文通过windbg分析了电脑出现的IRQL_NOT_LESS_OR_EQUAL蓝屏问题,并尝试了多种解决方法,最终通过硬件清理暂时解决了问题。
857 0
windbg分析 IRQL_NOT_LESS_OR_EQUAL 蓝屏问题
|
9月前
|
人工智能 算法
大模型不会推理,为什么也能有思路?有人把原理搞明白了
大模型(LLMs)在推理任务上表现出与人类不同的问题解决思路。最新研究《Procedural Knowledge in Pretraining Drives Reasoning in Large Language Models》发现,大模型通过合成程序性知识来完成推理任务,而非简单检索答案。这为理解其推理能力提供了新视角,并指出了改进方向,如设计更有效的算法和使用更大规模数据。论文链接:https://arxiv.org/abs/2411.12580。
290 3
|
中间件 Go 数据库
slog 简介:用于 Go 的结构化日志
slog 简介:用于 Go 的结构化日志
E0144 “const char *“ 类型的值不能用于初始化 “char *“ 类型的实体
E0144 “const char *“ 类型的值不能用于初始化 “char *“ 类型的实体
354 0
|
Java Linux 开发工具
IDEA中git提交前如何关闭code analysis以及开启格式化代码
【10月更文挑战第12天】本文介绍了在 IntelliJ IDEA 中关闭代码分析和开启代码格式化的步骤。关闭代码分析可通过取消默认启用检查或针对特定规则进行调整实现,同时可通过设置 VCS 静默模式在提交时跳过检查。开启代码格式化则需在 `Settings` 中配置 `Code Style` 规则,并通过创建 Git 钩子实现提交前自动格式化。
4419 3
|
存储 缓存 NoSQL
Nginx缓存
Nginx缓存
132 2
|
算法
算法沉淀 —— 动态规划篇(斐波那契数列模型)
算法沉淀 —— 动态规划篇(斐波那契数列模型)
159 0
|
网络协议 开发工具 Android开发
GB28181-2022注册注销基本要求、注册重定向解读和技术实现
GB28181-2022注册、注销基本要求相对GB28181-2016版本,做了一定的调整,新调整的部分如下:
440 0
codeforces 347A - Difference Row
给你一个序列,让你求(x1 - x2) + (x2 - x3) + ... + (xn - 1 - xn).值最大的一个序列,我们化简一下公式就会发现(x1 - x2) + (x2 - x3) + ... + (xn - 1 - xn). = x1 - xn, 也就是说只有第一个和最后一个是确定的,其他的随便了! 也不是了, 还要让你按字典序最小的排列,也就是说其他的是按飞递减序排列的,简单的一次排序就OK了。
66 0