docs: update RHI API docs

This commit is contained in:
2026-03-20 02:35:45 +08:00
parent ea756c0177
commit 070b444f8f
501 changed files with 13493 additions and 2022 deletions

View File

@@ -1,24 +1,46 @@
# OpenGLCommandList::Clear
```cpp
void Clear(float r, float g, float b, float a, unsigned int buffers);
void Clear(float r, float g, float b, float a, unsigned int buffers)
```
清除缓冲区。
清除指定的缓冲区。
**参数:**
- `r` - 红色分量
- `g` - 绿色分量
- `b` - 蓝色分量
- `a` - Alpha 分量
- `buffers` - 要清除的缓冲区标志
- `r` - 清除颜色红色分量(范围 0.0f - 1.0f
- `g` - 清除颜色绿色分量(范围 0.0f - 1.0f
- `b` - 清除颜色蓝色分量(范围 0.0f - 1.0f
- `a` - 清除颜色 Alpha 分量(范围 0.0f - 1.0f
- `buffers` - 要清除的缓冲区标志,使用 `ClearFlag` 枚举值的位或组合:
- `ClearFlag::Color` (1) - 清除颜色缓冲区
- `ClearFlag::Depth` (2) - 清除深度缓冲区
- `ClearFlag::Stencil` (4) - 清除模板缓冲区
**返回值**:无
**示例:**
```cpp
commandList->Clear(0.0f, 0.0f, 0.0f, 1.0f, Color | Depth);
// 清除颜色缓冲区
commandList->Clear(0.0f, 0.0f, 0.0f, 1.0f, static_cast<unsigned int>(ClearFlag::Color));
// 清除颜色和深度缓冲区
commandList->Clear(0.0f, 0.0f, 0.0f, 1.0f,
static_cast<unsigned int>(ClearFlag::Color) |
static_cast<unsigned int>(ClearFlag::Depth));
// 清除所有缓冲区
commandList->Clear(0.0f, 0.0f, 0.0f, 1.0f,
static_cast<unsigned int>(ClearFlag::Color) |
static_cast<unsigned int>(ClearFlag::Depth) |
static_cast<unsigned int>(ClearFlag::Stencil));
```
## 相关文档
- [OpenGLCommandList 总览](command-list.md) - 返回类总览
- [ClearColor](clear-color.md) - 仅清除颜色缓冲区
- [ClearDepth](clear-depth.md) - 仅清除深度缓冲区
- [ClearStencil](clear-stencil.md) - 仅清除模板缓冲区
- [ClearDepthStencil](clear-depth-stencil.md) - 清除深度和模板缓冲区
- [ClearFlag 枚举](../../enums/clear-flag.md) - 清除缓冲区标志