修复的问题: - math: 修复 Quaternion::Normalize 链接错误 - containers: HashMap 迭代器示例使用不存在的 cbegin/cend,删除冗余构造函数声明 - core: RefCounted 析构函数访问级别修正 (protected) - debug: LogLevelToString 示例返回值大小写修正 - memory: 修正 LinearAllocator::Reallocate 返回 nullptr,ProxyAllocator 统计描述,头文件路径 IAllocator.h -> Allocator.h - resources: Texture::Create mipLevels 参数描述修正 - rhi: 修复多处链接错误,新增缺失的方法文档 - threading: TaskSystem 配置项未实现状态标注,Wait 方法空实现标注
1.6 KiB
1.6 KiB
RHISwapChain
命名空间: XCEngine::RHI
类型: class (abstract)
描述: GPU 交换链抽象接口,用于管理窗口渲染和帧缓冲区切换。
公共方法
生命周期
| 方法 | 文档 |
|---|---|
Shutdown |
详细文档 |
交换链操作
| 方法 | 文档 |
|---|---|
GetCurrentBackBufferIndex |
详细文档 |
GetCurrentBackBuffer |
详细文档 |
Present |
详细文档 |
Resize |
详细文档 |
全屏模式
| 方法 | 文档 |
|---|---|
SetFullscreen |
详细文档 |
IsFullscreen |
详细文档 |
窗口事件
| 方法 | 文档 |
|---|---|
ShouldClose |
详细文档 |
SetShouldClose |
详细文档 |
PollEvents |
详细文档 |
其他
| 方法 | 文档 |
|---|---|
GetNativeHandle |
详细文档 |
使用示例
while (!swapChain->ShouldClose()) {
swapChain->PollEvents();
RHITexture* backBuffer = swapChain->GetCurrentBackBuffer();
commandList->Reset();
commandList->SetRenderTargets(1, &backBuffer, nullptr);
commandList->ClearRenderTarget(backBuffer, clearColor);
commandList->Close();
commandQueue->ExecuteCommandLists(1, (void**)&commandList);
swapChain->Present(1, 0);
}
相关文档
- ../rhi/rhi.md - RHI 模块总览
- RHITexture - 纹理资源