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

849 B

RHIDevice::CreateSwapChain

virtual RHISwapChain* CreateSwapChain(const SwapChainDesc& desc) = 0;

创建交换链,用于管理窗口渲染和帧缓冲区切换。

参数:

  • desc - 交换链描述符,包含尺寸、缓冲数量、格式等

返回: 新创建的交换链指针,失败返回 nullptr

复杂度: O(1)

示例:

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);

相关文档