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
This commit is contained in:
19
docs/api/rhi/swap-chain/get-current-back-buffer-index.md
Normal file
19
docs/api/rhi/swap-chain/get-current-back-buffer-index.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# RHISwapChain::GetCurrentBackBufferIndex
|
||||
|
||||
```cpp
|
||||
virtual uint32_t GetCurrentBackBufferIndex() const = 0;
|
||||
```
|
||||
|
||||
获取当前后台缓冲区索引。
|
||||
|
||||
**返回:** 当前后台缓冲区索引
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
uint32_t index = swapChain->GetCurrentBackBufferIndex();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
19
docs/api/rhi/swap-chain/get-current-back-buffer.md
Normal file
19
docs/api/rhi/swap-chain/get-current-back-buffer.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# RHISwapChain::GetCurrentBackBuffer
|
||||
|
||||
```cpp
|
||||
virtual RHITexture* GetCurrentBackBuffer() = 0;
|
||||
```
|
||||
|
||||
获取当前后台缓冲区纹理。
|
||||
|
||||
**返回:** 当前后台缓冲区纹理指针
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
RHITexture* backBuffer = swapChain->GetCurrentBackBuffer();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
15
docs/api/rhi/swap-chain/get-native-handle.md
Normal file
15
docs/api/rhi/swap-chain/get-native-handle.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# RHISwapChain::GetNativeHandle
|
||||
|
||||
```cpp
|
||||
virtual void* GetNativeHandle() = 0;
|
||||
```
|
||||
|
||||
获取原生 API 句柄。
|
||||
|
||||
**返回:** 原生交换链句柄
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
21
docs/api/rhi/swap-chain/is-fullscreen.md
Normal file
21
docs/api/rhi/swap-chain/is-fullscreen.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# RHISwapChain::IsFullscreen
|
||||
|
||||
```cpp
|
||||
virtual bool IsFullscreen() const = 0;
|
||||
```
|
||||
|
||||
检查是否处于全屏模式。
|
||||
|
||||
**返回:** 如果全屏返回 true
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
if (swapChain->IsFullscreen()) {
|
||||
// 全屏模式
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
89
docs/api/rhi/swap-chain/methods.md
Normal file
89
docs/api/rhi/swap-chain/methods.md
Normal file
@@ -0,0 +1,89 @@
|
||||
# RHISwapChain 方法
|
||||
|
||||
## Shutdown
|
||||
|
||||
```cpp
|
||||
virtual void Shutdown() = 0;
|
||||
```
|
||||
|
||||
关闭交换链。
|
||||
|
||||
## GetCurrentBackBufferIndex
|
||||
|
||||
```cpp
|
||||
virtual uint32_t GetCurrentBackBufferIndex() const = 0;
|
||||
```
|
||||
|
||||
获取当前后台缓冲索引。
|
||||
|
||||
## GetCurrentBackBuffer
|
||||
|
||||
```cpp
|
||||
virtual RHITexture* GetCurrentBackBuffer() = 0;
|
||||
```
|
||||
|
||||
获取当前后台缓冲纹理。
|
||||
|
||||
## Present
|
||||
|
||||
```cpp
|
||||
virtual void Present(uint32_t syncInterval = 1, uint32_t flags = 0) = 0;
|
||||
```
|
||||
|
||||
呈现渲染结果。
|
||||
|
||||
## Resize
|
||||
|
||||
```cpp
|
||||
virtual void Resize(uint32_t width, uint32_t height) = 0;
|
||||
```
|
||||
|
||||
调整交换链大小。
|
||||
|
||||
## SetFullscreen
|
||||
|
||||
```cpp
|
||||
virtual void SetFullscreen(bool fullscreen) = 0;
|
||||
```
|
||||
|
||||
设置全屏模式。
|
||||
|
||||
## IsFullscreen
|
||||
|
||||
```cpp
|
||||
virtual bool IsFullscreen() const = 0;
|
||||
```
|
||||
|
||||
检查是否全屏。
|
||||
|
||||
## ShouldClose
|
||||
|
||||
```cpp
|
||||
virtual bool ShouldClose() const = 0;
|
||||
```
|
||||
|
||||
检查是否应该关闭。
|
||||
|
||||
## SetShouldClose
|
||||
|
||||
```cpp
|
||||
virtual void SetShouldClose(bool shouldClose) = 0;
|
||||
```
|
||||
|
||||
设置关闭标志。
|
||||
|
||||
## PollEvents
|
||||
|
||||
```cpp
|
||||
virtual void PollEvents() = 0;
|
||||
```
|
||||
|
||||
处理窗口事件。
|
||||
|
||||
## GetNativeHandle
|
||||
|
||||
```cpp
|
||||
virtual void* GetNativeHandle() = 0;
|
||||
```
|
||||
|
||||
获取原生 API 句柄。
|
||||
17
docs/api/rhi/swap-chain/poll-events.md
Normal file
17
docs/api/rhi/swap-chain/poll-events.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# RHISwapChain::PollEvents
|
||||
|
||||
```cpp
|
||||
virtual void PollEvents() = 0;
|
||||
```
|
||||
|
||||
处理窗口事件。
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
swapChain->PollEvents();
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
21
docs/api/rhi/swap-chain/present.md
Normal file
21
docs/api/rhi/swap-chain/present.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# RHISwapChain::Present
|
||||
|
||||
```cpp
|
||||
virtual void Present(uint32_t syncInterval = 1, uint32_t flags = 0) = 0;
|
||||
```
|
||||
|
||||
呈现后台缓冲区。
|
||||
|
||||
**参数:**
|
||||
- `syncInterval` - 垂直同步间隔(0=立即,1+=等待)
|
||||
- `flags` - 呈现标志
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
swapChain->Present(1); // 垂直同步呈现
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
27
docs/api/rhi/swap-chain/resize.md
Normal file
27
docs/api/rhi/swap-chain/resize.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# RHISwapChain::Resize
|
||||
|
||||
```cpp
|
||||
virtual void Resize(uint32_t width, uint32_t height) = 0;
|
||||
```
|
||||
|
||||
调整交换链大小。
|
||||
|
||||
**参数:**
|
||||
- `width` - 新的宽度
|
||||
- `height` - 新的高度
|
||||
|
||||
**复杂度:** O(n) - 取决于缓冲区数量
|
||||
|
||||
**注意:**
|
||||
- 调整大小会导致所有后台缓冲区重建
|
||||
- 应在渲染循环外调用
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
swapChain->Resize(1920, 1080);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
20
docs/api/rhi/swap-chain/set-fullscreen.md
Normal file
20
docs/api/rhi/swap-chain/set-fullscreen.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# RHISwapChain::SetFullscreen
|
||||
|
||||
```cpp
|
||||
virtual void SetFullscreen(bool fullscreen) = 0;
|
||||
```
|
||||
|
||||
设置全屏模式。
|
||||
|
||||
**参数:**
|
||||
- `fullscreen` - 是否全屏
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
swapChain->SetFullscreen(true);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
20
docs/api/rhi/swap-chain/set-should-close.md
Normal file
20
docs/api/rhi/swap-chain/set-should-close.md
Normal file
@@ -0,0 +1,20 @@
|
||||
# RHISwapChain::SetShouldClose
|
||||
|
||||
```cpp
|
||||
virtual void SetShouldClose(bool shouldClose) = 0;
|
||||
```
|
||||
|
||||
设置交换链关闭标志。
|
||||
|
||||
**参数:**
|
||||
- `shouldClose` - 是否应该关闭
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
swapChain->SetShouldClose(true);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
21
docs/api/rhi/swap-chain/should-close.md
Normal file
21
docs/api/rhi/swap-chain/should-close.md
Normal file
@@ -0,0 +1,21 @@
|
||||
# RHISwapChain::ShouldClose
|
||||
|
||||
```cpp
|
||||
virtual bool ShouldClose() const = 0;
|
||||
```
|
||||
|
||||
检查交换链是否应该关闭。
|
||||
|
||||
**返回:** 如果应该关闭返回 true
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
while (!swapChain->ShouldClose()) {
|
||||
// 渲染循环
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
13
docs/api/rhi/swap-chain/shutdown.md
Normal file
13
docs/api/rhi/swap-chain/shutdown.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# RHISwapChain::Shutdown
|
||||
|
||||
```cpp
|
||||
virtual void Shutdown() = 0;
|
||||
```
|
||||
|
||||
关闭交换链,释放所有相关资源。
|
||||
|
||||
**复杂度:** O(n) - 取决于管理的缓冲区数量
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [RHISwapChain 总览](swap-chain.md) - 返回类总览
|
||||
43
docs/api/rhi/swap-chain/swap-chain.md
Normal file
43
docs/api/rhi/swap-chain/swap-chain.md
Normal file
@@ -0,0 +1,43 @@
|
||||
# RHISwapChain
|
||||
|
||||
**命名空间**: `XCEngine::RHI`
|
||||
|
||||
**类型**: `class` (abstract)
|
||||
|
||||
**描述**: GPU 交换链抽象接口,用于管理窗口渲染和帧缓冲区切换。
|
||||
|
||||
## 公共方法
|
||||
|
||||
| 方法 | 描述 |
|
||||
|------|------|
|
||||
| [`Shutdown`](shutdown.md) | 关闭并释放资源 |
|
||||
| [`GetCurrentBackBufferIndex`](get-current-back-buffer-index.md) | 获取当前后台缓冲区索引 |
|
||||
| [`GetCurrentBackBuffer`](get-current-back-buffer.md) | 获取当前后台缓冲区 |
|
||||
| [`Present`](present.md) | 呈现画面 |
|
||||
| [`Resize`](resize.md) | 调整交换链大小 |
|
||||
| [`SetFullscreen`](set-fullscreen.md) | 设置全屏模式 |
|
||||
| [`IsFullscreen`](is-fullscreen.md) | 检查是否全屏 |
|
||||
| [`ShouldClose`](should-close.md) | 检查是否应关闭 |
|
||||
| [`SetShouldClose`](set-should-close.md) | 设置关闭标志 |
|
||||
| [`PollEvents`](poll-events.md) | 处理窗口事件 |
|
||||
| [`GetNativeHandle`](get-native-handle.md) | 获取原生句柄 |
|
||||
|
||||
## 使用示例
|
||||
|
||||
```cpp
|
||||
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.md) - RHI 模块总览
|
||||
- [RHITexture](../texture/texture.md) - 纹理资源
|
||||
Reference in New Issue
Block a user