docs: update RHI API docs
This commit is contained in:
@@ -1,17 +1,61 @@
|
||||
# OpenGLDepthStencilView::Initialize
|
||||
|
||||
```cpp
|
||||
bool Initialize(unsigned int texture, int width, int height);
|
||||
```
|
||||
|
||||
初始化深度模板视图。
|
||||
|
||||
## 重载 1
|
||||
|
||||
```cpp
|
||||
bool Initialize(unsigned int texture, const OpenGLDepthStencilViewDesc& desc);
|
||||
```
|
||||
|
||||
使用描述结构体初始化深度模板视图,将指定的 OpenGL 纹理创建为深度模板帧缓冲对象。
|
||||
|
||||
**参数:**
|
||||
- `texture` - OpenGL 纹理 ID
|
||||
- `width` - 宽度
|
||||
- `height` - 高度
|
||||
- `desc` - 深度模板视图描述结构体
|
||||
|
||||
**返回:** 成功返回 true
|
||||
**返回:** 成功返回 `true`,失败返回 `false`。失败时帧缓冲不会被创建。
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
OpenGLDepthStencilView dsv;
|
||||
OpenGLDepthStencilViewDesc desc;
|
||||
desc.type = DepthStencilType::Texture2D;
|
||||
desc.mipLevel = 0;
|
||||
desc.baseArraySlice = 0;
|
||||
desc.arraySize = 1;
|
||||
dsv.Initialize(textureID, desc);
|
||||
```
|
||||
|
||||
## 重载 2
|
||||
|
||||
```cpp
|
||||
bool Initialize(unsigned int texture, int mipLevel = 0);
|
||||
```
|
||||
|
||||
使用简单参数初始化深度模板视图。
|
||||
|
||||
**参数:**
|
||||
- `texture` - OpenGL 纹理 ID
|
||||
- `mipLevel` - mipmap 级别(默认为 0)
|
||||
|
||||
**返回:** 成功返回 true,失败返回 false
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
// 使用描述结构体初始化
|
||||
OpenGLDepthStencilViewDesc desc;
|
||||
desc.type = DepthStencilType::Texture2D;
|
||||
desc.mipLevel = 0;
|
||||
desc.baseArraySlice = 0;
|
||||
desc.arraySize = 1;
|
||||
dsv.Initialize(textureID, desc);
|
||||
|
||||
// 使用简单参数初始化
|
||||
dsv.Initialize(textureID, 0);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
|
||||
Reference in New Issue
Block a user