Fixed the following issues: - command-list.md: Shutdown linked to threading/task-system instead of local shutdown.md - fence.md: Wait linked to threading/task-group instead of local wait.md - factory/create-rhi-device-string.md: Claimed Vulkan/Metal support but source doesn't support them - opengl/buffer/buffer.md: GetType linked to command-queue/get-type (wrong type) - d3d12/device/device.md: Initialize/Shutdown linked to threading/task-system - d3d12/command-list/command-list.md: Initialize/Shutdown/Reset/Close/Clear linked to wrong docs - d3d12/texture/texture.md: Initialize/Shutdown linked to threading/task-system - opengl/command-list/command-list.md: Shutdown linked to threading/task-system - opengl/device/device.md: GetNativeHandle incorrectly linked to get-window.md All links validated with fix_links.py - no broken references remaining.
32 lines
680 B
Markdown
32 lines
680 B
Markdown
# RHIFactory::CreateRHIDevice (string)
|
|
|
|
```cpp
|
|
static RHIDevice* CreateRHIDevice(const std::string& typeName);
|
|
```
|
|
|
|
根据字符串名称创建 RHI 设备。
|
|
|
|
**参数:**
|
|
- `typeName` - 后端类型名称字符串(不区分大小写)
|
|
|
|
**返回:** 新创建的设备指针,失败返回 `nullptr`
|
|
|
|
**复杂度:** O(1)
|
|
|
|
**支持的类型名称:**
|
|
- `"D3D12"` / `"d3d12"`
|
|
- `"OpenGL"` / `"opengl"` / `"GL"`
|
|
- Vulkan 和 Metal 暂不支持
|
|
|
|
**示例:**
|
|
|
|
```cpp
|
|
// 从配置文件读取后端类型
|
|
std::string backendType = "D3D12";
|
|
RHIDevice* device = RHIFactory::CreateRHIDevice(backendType);
|
|
```
|
|
|
|
## 相关文档
|
|
|
|
- [RHIFactory 总览](factory.md) - 返回类总览
|