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

40 lines
667 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.
# OpenGLFence::Shutdown
```cpp
void Shutdown() override;
```
释放 OpenGL 栅栏资源。
## 详细描述
如果 `m_sync` 不为 `nullptr`,调用 `glDeleteSync()` 删除 OpenGL 同步对象,然后将 `m_sync` 置为 `nullptr`
此方法由析构函数自动调用,确保资源正确释放。
## 参数
## 返回值
## 示例
```cpp
OpenGLFence fence;
fence.Initialize(false);
fence.Signal();
// 显式关闭,释放 GLsync 资源
fence.Shutdown();
// fence 对象销毁时会再次调用 Shutdown但已是安全操作
```
## 相关文档
- [OpenGLFence 总览](fence.md) - 返回类总览
- [Initialize](initialize.md) - 初始化