Files
XCEngine/docs/api/rhi/opengl/render-target-view/initialize.md
2026-03-20 02:35:45 +08:00

30 lines
648 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OpenGLRenderTargetView::Initialize
```cpp
bool Initialize(unsigned int texture, const OpenGLRenderTargetViewDesc& desc);
bool Initialize(unsigned int texture, int mipLevel = 0);
```
初始化渲染目标视图。
**重载 1 参数:**
- `texture` - OpenGL 纹理 ID
- `desc` - 渲染目标视图描述
**重载 2 参数:**
- `texture` - OpenGL 纹理 ID
- `mipLevel` - mipmap 级别(默认为 0
**返回:** `bool` - 成功返回 true失败返回 false
**示例:**
```cpp
OpenGLRenderTargetView rtv;
rtv.Initialize(texture, 0);
```
## 相关文档
- [OpenGLRenderTargetView 总览](render-target-view.md) - 返回类总览