docs: update RHI API docs
This commit is contained in:
33
docs/api/rhi/opengl/vertex-array/initialize.md
Normal file
33
docs/api/rhi/opengl/vertex-array/initialize.md
Normal file
@@ -0,0 +1,33 @@
|
||||
# OpenGLVertexArray::Initialize
|
||||
|
||||
```cpp
|
||||
bool Initialize()
|
||||
```
|
||||
|
||||
初始化 OpenGL 顶点数组对象。
|
||||
|
||||
**详细描述:**
|
||||
调用 `glGenVertexArrays(1, &m_vao)` 生成一个新的顶点数组对象并存储其 ID。
|
||||
必须在使用 VAO 之前调用。
|
||||
|
||||
**返回:** `bool` - 始终返回 `true`(当前实现不进行错误检查)
|
||||
|
||||
**注意:**
|
||||
- 如果初始化失败,`m_vao` 将保持为 0
|
||||
- 当前实现不检查 OpenGL 错误,建议在调用前确保 OpenGL 上下文已创建
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
OpenGLVertexArray vao;
|
||||
if (vao.Initialize()) {
|
||||
// VAO 初始化成功,可以添加缓冲和绑定
|
||||
vao.AddVertexBuffer(vbo, positionAttr);
|
||||
vao.Bind();
|
||||
}
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [OpenGLVertexArray](vertex-array.md) - 返回类总览
|
||||
- [Shutdown](shutdown.md) - 关闭方法
|
||||
Reference in New Issue
Block a user