Files
XCEngine/docs/api/rhi/opengl/vertex-array/shutdown.md
2026-03-20 02:35:45 +08:00

33 lines
736 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.
# OpenGLVertexArray::Shutdown
```cpp
void Shutdown()
```
关闭顶点数组对象,释放 OpenGL 资源。
**详细描述:**
调用 `glDeleteVertexArrays(1, &m_vao)` 释放 VAO 资源,并将 `m_vao` 重置为 0。
**释放的资源:**
- `m_vao` - 顶点数组对象
**不释放的资源:**
- 顶点缓冲区(由独立的缓冲区管理对象管理)
- 索引缓冲区(由独立的缓冲区管理对象管理)
**幂等性:**
可安全多次调用。如果 `m_vao` 为 0则不执行任何操作。
**示例:**
```cpp
vao.Shutdown(); // 释放 VAO
// 此后不能再调用 Bind()
```
## 相关文档
- [OpenGLVertexArray](vertex-array.md) - 返回类总览
- [Initialize](initialize.md) - 初始化方法