Files
XCEngine/docs/api/d3d12/d3d12-swap-chain-initialize.md
ssdfasd 7c3f304688 refactor(docs): D3D12模块文档重构 - 修复链接错误并新增Buffer/Texture/SwapChain方法文档
- 新增32个方法文档(D3D12Buffer 13个,D3D12Texture 12个,D3D12SwapChain 6个)
- 修复11处跨模块引用错误(rhi-device.md, rhi-texture.md等路径错误)
- 清理d3d12-overview.md移除不存在的类引用
- 修复D3D12Device/D3D12CommandList/D3D12CommandQueue方法列表
- D3D12模块现无broken links
2026-03-26 01:49:24 +08:00

37 lines
854 B
Markdown

# D3D12SwapChain::Initialize
初始化 D3D12SwapChain 交换链。
## 重载 1: 从头创建
```cpp
bool Initialize(IDXGIFactory4* factory, ID3D12CommandQueue* commandQueue, HWND windowHandle, uint32_t width, uint32_t height, uint32_t bufferCount = 2);
```
**参数:**
- `factory` - DXGI 工厂指针
- `commandQueue` - 命令队列指针
- `windowHandle` - 窗口句柄
- `width` - 宽度
- `height` - 高度
- `bufferCount` - 缓冲数量,默认为 2
**返回:** `bool` - 初始化成功返回 true
## 重载 2: 从现有交换链创建
```cpp
bool Initialize(IDXGISwapChain* swapChain, uint32_t width, uint32_t height);
```
**参数:**
- `swapChain` - 现有 DXGI 交换链指针
- `width` - 宽度
- `height` - 高度
**返回:** `bool` - 初始化成功返回 true
## 相关文档
- [D3D12SwapChain 总览](d3d12-swap-chain.md)