Fix RHI documentation discrepancies and add missing doc files
Fixed incorrect links in OpenGL documentation:
- Fixed wrong links to threading/task-system docs for Initialize/Shutdown methods
- Fixed wrong links to buffer docs for GetNativeHandle methods
- Fixed wrong links to shader docs for Bind/Unbind methods
- Fixed wrong links to command-list docs for Clear/Reset/Close methods
- Fixed wrong links to buffer/get-size.md for width/height methods
Added missing documentation files:
- OpenGL buffer: bind.md, unbind.md, get-type.md, initialize.md
- OpenGL fence: initialize.md, reset.md
- OpenGL swap-chain: get-size.md, initialize.md
- OpenGL render-target-view: initialize.md, shutdown.md, bind.md, unbind.md, clear.md, get-size.md
- OpenGL depth-stencil-view: initialize.md, shutdown.md, bind.md, unbind.md, get-size.md
- OpenGL command-list: clear.md
All links validated with fix_links.py - no broken references.
2026-03-19 00:54:54 +08:00
|
|
|
|
# OpenGLRenderTargetView::Clear
|
|
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
|
void Clear(float r, float g, float b, float a);
|
2026-03-20 02:35:45 +08:00
|
|
|
|
void Clear(float r, float g, float b, float a, float depth, uint8_t stencil);
|
Fix RHI documentation discrepancies and add missing doc files
Fixed incorrect links in OpenGL documentation:
- Fixed wrong links to threading/task-system docs for Initialize/Shutdown methods
- Fixed wrong links to buffer docs for GetNativeHandle methods
- Fixed wrong links to shader docs for Bind/Unbind methods
- Fixed wrong links to command-list docs for Clear/Reset/Close methods
- Fixed wrong links to buffer/get-size.md for width/height methods
Added missing documentation files:
- OpenGL buffer: bind.md, unbind.md, get-type.md, initialize.md
- OpenGL fence: initialize.md, reset.md
- OpenGL swap-chain: get-size.md, initialize.md
- OpenGL render-target-view: initialize.md, shutdown.md, bind.md, unbind.md, clear.md, get-size.md
- OpenGL depth-stencil-view: initialize.md, shutdown.md, bind.md, unbind.md, get-size.md
- OpenGL command-list: clear.md
All links validated with fix_links.py - no broken references.
2026-03-19 00:54:54 +08:00
|
|
|
|
```
|
|
|
|
|
|
|
2026-03-20 02:35:45 +08:00
|
|
|
|
清除渲染目标视图的颜色缓冲区和可选的深度/模板缓冲区。
|
Fix RHI documentation discrepancies and add missing doc files
Fixed incorrect links in OpenGL documentation:
- Fixed wrong links to threading/task-system docs for Initialize/Shutdown methods
- Fixed wrong links to buffer docs for GetNativeHandle methods
- Fixed wrong links to shader docs for Bind/Unbind methods
- Fixed wrong links to command-list docs for Clear/Reset/Close methods
- Fixed wrong links to buffer/get-size.md for width/height methods
Added missing documentation files:
- OpenGL buffer: bind.md, unbind.md, get-type.md, initialize.md
- OpenGL fence: initialize.md, reset.md
- OpenGL swap-chain: get-size.md, initialize.md
- OpenGL render-target-view: initialize.md, shutdown.md, bind.md, unbind.md, clear.md, get-size.md
- OpenGL depth-stencil-view: initialize.md, shutdown.md, bind.md, unbind.md, get-size.md
- OpenGL command-list: clear.md
All links validated with fix_links.py - no broken references.
2026-03-19 00:54:54 +08:00
|
|
|
|
|
2026-03-20 02:35:45 +08:00
|
|
|
|
**重载 1 参数(仅清除颜色):**
|
|
|
|
|
|
- `r` - 红色分量(0.0f - 1.0f)
|
|
|
|
|
|
- `g` - 绿色分量(0.0f - 1.0f)
|
|
|
|
|
|
- `b` - 蓝色分量(0.0f - 1.0f)
|
|
|
|
|
|
- `a` - Alpha 分量(0.0f - 1.0f)
|
|
|
|
|
|
|
|
|
|
|
|
**重载 2 参数(清除颜色、深度和模板):**
|
Fix RHI documentation discrepancies and add missing doc files
Fixed incorrect links in OpenGL documentation:
- Fixed wrong links to threading/task-system docs for Initialize/Shutdown methods
- Fixed wrong links to buffer docs for GetNativeHandle methods
- Fixed wrong links to shader docs for Bind/Unbind methods
- Fixed wrong links to command-list docs for Clear/Reset/Close methods
- Fixed wrong links to buffer/get-size.md for width/height methods
Added missing documentation files:
- OpenGL buffer: bind.md, unbind.md, get-type.md, initialize.md
- OpenGL fence: initialize.md, reset.md
- OpenGL swap-chain: get-size.md, initialize.md
- OpenGL render-target-view: initialize.md, shutdown.md, bind.md, unbind.md, clear.md, get-size.md
- OpenGL depth-stencil-view: initialize.md, shutdown.md, bind.md, unbind.md, get-size.md
- OpenGL command-list: clear.md
All links validated with fix_links.py - no broken references.
2026-03-19 00:54:54 +08:00
|
|
|
|
- `r` - 红色分量
|
|
|
|
|
|
- `g` - 绿色分量
|
|
|
|
|
|
- `b` - 蓝色分量
|
|
|
|
|
|
- `a` - Alpha 分量
|
2026-03-20 02:35:45 +08:00
|
|
|
|
- `depth` - 深度值(通常 0.0f 或 1.0f)
|
|
|
|
|
|
- `stencil` - 模板值(0-255)
|
|
|
|
|
|
|
|
|
|
|
|
**示例:**
|
|
|
|
|
|
|
|
|
|
|
|
```cpp
|
|
|
|
|
|
// 仅清除颜色缓冲
|
|
|
|
|
|
rtv.Clear(0.1f, 0.1f, 0.1f, 1.0f);
|
|
|
|
|
|
|
|
|
|
|
|
// 清除颜色、深度和模板缓冲
|
|
|
|
|
|
rtv.Clear(0.1f, 0.1f, 0.1f, 1.0f, 1.0f, 0);
|
|
|
|
|
|
```
|
Fix RHI documentation discrepancies and add missing doc files
Fixed incorrect links in OpenGL documentation:
- Fixed wrong links to threading/task-system docs for Initialize/Shutdown methods
- Fixed wrong links to buffer docs for GetNativeHandle methods
- Fixed wrong links to shader docs for Bind/Unbind methods
- Fixed wrong links to command-list docs for Clear/Reset/Close methods
- Fixed wrong links to buffer/get-size.md for width/height methods
Added missing documentation files:
- OpenGL buffer: bind.md, unbind.md, get-type.md, initialize.md
- OpenGL fence: initialize.md, reset.md
- OpenGL swap-chain: get-size.md, initialize.md
- OpenGL render-target-view: initialize.md, shutdown.md, bind.md, unbind.md, clear.md, get-size.md
- OpenGL depth-stencil-view: initialize.md, shutdown.md, bind.md, unbind.md, get-size.md
- OpenGL command-list: clear.md
All links validated with fix_links.py - no broken references.
2026-03-19 00:54:54 +08:00
|
|
|
|
|
|
|
|
|
|
## 相关文档
|
|
|
|
|
|
|
|
|
|
|
|
- [OpenGLRenderTargetView 总览](render-target-view.md) - 返回类总览
|