Files
XCSDD/docs/api/rhi/device/create-swap-chain.md
ssdfasd 58a83f445a fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling
- Improve link styling with underline decoration
- Hide leaf nodes from tree, only show directories
- Fix log file path for packaged app
2026-03-19 12:44:08 +08:00

35 lines
849 B
Markdown

# RHIDevice::CreateSwapChain
```cpp
virtual RHISwapChain* CreateSwapChain(const SwapChainDesc& desc) = 0;
```
创建交换链,用于管理窗口渲染和帧缓冲区切换。
**参数:**
- `desc` - 交换链描述符,包含尺寸、缓冲数量、格式等
**返回:** 新创建的交换链指针,失败返回 `nullptr`
**复杂度:** O(1)
**示例:**
```cpp
SwapChainDesc swapChainDesc;
swapChainDesc.width = 1280;
swapChainDesc.height = 720;
swapChainDesc.bufferCount = 2;
swapChainDesc.format = (uint32_t)Format::R8G8B8A8_UNorm;
swapChainDesc.refreshRate = 60;
swapChainDesc.sampleCount = 1;
swapChainDesc.sampleQuality = 0;
RHISwapChain* swapChain = device->CreateSwapChain(swapChainDesc);
```
## 相关文档
- [RHIDevice 总览](device.md) - 返回类总览
- [RHISwapChain](../swap-chain/swap-chain.md) - 交换链类