# 变更记录:DX12 初始框架 **提交日期**: 2026-03-26 **提交哈希**: `60f73b5` **变更类型**: 初始化项目 --- ## 变更概述 本次提交是项目的初始版本,建立了完整的引擎基础框架,包括组件系统、平台抽象层、内容加载器和测试框架。 ## 新增模块 ### Engine/Common/ | 文件 | 说明 | |------|------| | `CommonHeader.h` | 公共头文件,定义基础类型和宏 | | `Id.h` | 强类型 ID 系统 | | `XEnginType.h` | 引擎类型定义 | ### Engine/Components/ | 文件 | 说明 | |------|------| | `Entity.cpp/.h` | 实体组件实现 | | `Script.cpp/.h` | 脚本组件实现 | | `Transform.cpp/.h` | 变换组件实现 | ### Engine/EngineAPI/ | 文件 | 说明 | |------|------| | `Camera.h` | 相机 API | | `GameEntity.h` | 游戏实体 API | | `Light.h` | 光源 API | | `ScriptComponent.h` | 脚本组件 API | | `TransformComponent.h` | 变换组件 API | ### Engine/Platform/ | 文件 | 说明 | |------|------| | `Platform.h` | 平台抽象接口 | | `PlatformTypes.h` | 平台类型定义 | | `PlatformWin32.cpp` | Win32 平台实现 | | `Window.cpp/.h` | 窗口管理 | ### Engine/Content/ | 文件 | 说明 | |------|------| | `ContentLoader.cpp/.h` | 内容加载器 | | `ContentToEngine.cpp/.h` | 内容到引擎转换 | ### Engine/Utilities/ | 文件 | 说明 | |------|------| | `FreeList.h` | 空闲列表内存池 | | `IOStream.h` | IO 流工具 | | `Math.h` | 数学工具 | | `MathTypes.h` | 数学类型 | | `Vector.h` | 向量容器 | | `Utilities.h` | 通用工具 | ### ContentTools/ | 文件 | 说明 | |------|------| | `FbxImporter.cpp/.h` | FBX 模型导入 | | `Geometry.cpp/.h` | 几何处理 | | `MeshPrimitives.cpp/.h` | 网格图元 | ### EngineTest/ | 文件 | 说明 | |------|------| | `Main.cpp` | 测试入口 | | `Test.h` | 测试框架基类 | | `TestEntityComponent.h` | 实体组件测试 | | `ShaderComponents.cpp/.h` | 着色器组件测试 | | `Lights.cpp` | 光源测试 | | `RenderItem.cpp` | 渲染项测试 | --- ## 核心设计 ### 1. 强类型 ID 系统 ```cpp DEFINE_TYPED_ID(id_type); ``` 通过宏生成类型安全的 ID,支持代数校验防止使用已删除对象。 ### 2. 组件系统架构 - **EngineAPI 层**: 对外契约,暴露稳定接口 - **Components 层**: 运行时实现,管理内部存储 ### 3. 平台抽象 Win32 平台实现封装,上层代码通过抽象接口访问平台功能。 --- ## 相关文档 - [Id机制分析](../架构分析/Id机制分析.md) - [Entity组件分析](../架构分析/Entity组件分析.md) - [Script组件分析](../架构分析/Script组件分析.md) - [Transform组件分析](../架构分析/Transform组件分析.md) - [项目约定规范](../架构分析/项目约定规范.md)