2026-03-18 17:49:22 +08:00
|
|
|
# XCEngine API 文档总索引
|
|
|
|
|
|
|
|
|
|
**描述**: XCEngine 图形引擎的完整 API 文档索引。
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 模块导航
|
|
|
|
|
|
|
|
|
|
| 模块 | 文档目录 | 描述 |
|
|
|
|
|
|------|----------|------|
|
docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录
- 重命名 index.md 为 main.md
- 修正所有模块文档中的错误:
- math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式
- containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节
- core: 修复 types 链接错误
- debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI
- memory: 修复头文件路径, malloc vs operator new, 新增方法文档
- resources: 修复 Shader/Texture 链接错误
- threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接
- 验证: fix_links.py 确认 0 个断裂引用
2026-03-19 00:22:30 +08:00
|
|
|
| **RHI** | [rhi/](rhi/rhi.md) | 渲染硬件接口抽象层 |
|
2026-03-26 01:50:27 +08:00
|
|
|
| **D3D12** | [rhi/d3d12/](rhi/d3d12/d3d12.md) | DirectX 12 后端实现 |
|
|
|
|
|
| **OpenGL** | [rhi/opengl/](rhi/opengl/opengl.md) | OpenGL 后端实现 |
|
docs: 重构 API 文档结构并修正源码准确性
- 重组文档目录结构: 每个模块的概述页移动到模块子目录
- 重命名 index.md 为 main.md
- 修正所有模块文档中的错误:
- math: FromEuler→FromEulerAngles, TransformDirection 包含缩放, Box 是 OBB, Color::ToRGBA 格式
- containers: 新增 operator==/!= 文档, 补充 std::hash DJB 算法细节
- core: 修复 types 链接错误
- debug: LogLevelToString 返回大写, timestamp 是秒, Profiler 空实现标注, Windows API vs ANSI
- memory: 修复头文件路径, malloc vs operator new, 新增方法文档
- resources: 修复 Shader/Texture 链接错误
- threading: TaskSystem::Wait 空实现标注, ReadWriteLock 重入描述, LambdaTask 链接
- 验证: fix_links.py 确认 0 个断裂引用
2026-03-19 00:22:30 +08:00
|
|
|
| **Containers** | [containers/](containers/containers.md) | 容器数据结构 |
|
|
|
|
|
| **Memory** | [memory/](memory/memory.md) | 内存管理 |
|
|
|
|
|
| **Threading** | [threading/](threading/threading.md) | 多线程和任务系统 |
|
|
|
|
|
| **Core** | [core/](core/core.md) | 核心基础类型 |
|
|
|
|
|
| **Debug** | [debug/](debug/debug.md) | 调试和日志 |
|
|
|
|
|
| **Math** | [math/](math/math.md) | 数学库 |
|
|
|
|
|
| **Resources** | [resources/](resources/resources.md) | 资源管理系统 |
|
2026-03-22 01:56:16 +08:00
|
|
|
| **Audio** | [audio/](audio/audio.md) | 音频系统 |
|
|
|
|
|
| **Components** | [components/](components/components.md) | ECS 组件系统 |
|
2026-03-22 03:33:55 +08:00
|
|
|
| **Scene** | [scene/](scene/scene.md) | 场景管理系统 |
|
2026-03-18 17:49:22 +08:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 快速开始
|
|
|
|
|
|
|
|
|
|
### 创建渲染设备
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
#include <XCEngine/RHI/RHIFactory.h>
|
|
|
|
|
#include <XCEngine/RHI/RHIDevice.h>
|
|
|
|
|
|
|
|
|
|
// 创建 D3D12 设备
|
|
|
|
|
RHI::RHIDevice* device = RHI::RHIFactory::CreateRHIDevice(RHI::RHIType::D3D12);
|
|
|
|
|
|
|
|
|
|
// 初始化
|
|
|
|
|
RHI::RHIDeviceDesc desc;
|
|
|
|
|
desc.windowHandle = hwnd;
|
|
|
|
|
device->Initialize(desc);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 使用资源管理器
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
#include <XCEngine/Resources/ResourceManager.h>
|
|
|
|
|
|
|
|
|
|
// 加载纹理
|
|
|
|
|
auto texture = Resources::ResourceManager::Get().Load<Resources::Texture>("textures/player.png");
|
|
|
|
|
|
|
|
|
|
// 加载网格
|
|
|
|
|
auto mesh = Resources::ResourceManager::Get().Load<Resources::Mesh>("models/player.fbx");
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 日志记录
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
#include <XCEngine/Debug/Logger.h>
|
|
|
|
|
|
|
|
|
|
// 记录日志
|
|
|
|
|
XE_LOG(Debug::LogCategory::Rendering, Debug::LogLevel::Info, "Render started");
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### 数学运算
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
#include <XCEngine/Math/Matrix4.h>
|
|
|
|
|
|
|
|
|
|
// 创建变换矩阵
|
|
|
|
|
Math::Matrix4 transform = Math::Matrix4::TRS(position, rotation, scale);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 文档统计
|
|
|
|
|
|
|
|
|
|
| 模块 | 文档数量 |
|
|
|
|
|
|------|----------|
|
|
|
|
|
| RHI 抽象层 | 17 |
|
|
|
|
|
| D3D12 后端 | 24 |
|
|
|
|
|
| OpenGL 后端 | 14 |
|
|
|
|
|
| Math | 17 |
|
|
|
|
|
| Resources | 17 |
|
|
|
|
|
| Threading | 10 |
|
|
|
|
|
| Memory | 6 |
|
|
|
|
|
| Debug | 9 |
|
|
|
|
|
| Core | 6 |
|
|
|
|
|
| Containers | 4 |
|
2026-03-22 03:33:55 +08:00
|
|
|
| Audio | 10 |
|
|
|
|
|
| Components | 36 |
|
|
|
|
|
| Scene | 19 |
|
|
|
|
|
| **总计** | **143** |
|
2026-03-18 17:49:22 +08:00
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
## 相关文档
|
|
|
|
|
|
|
|
|
|
- [XCEngine 架构设计](../../docs/plan/XCEngine渲染引擎架构设计.md)
|
|
|
|
|
- [RHI 抽象层设计](../../docs/plan/RHI抽象层设计与实现.md)
|