720 B
720 B
OpenGLFence::GetNativeHandle
void* GetNativeHandle() override;
获取 OpenGL 同步对象句柄。
详细描述
返回指向 GLsync 对象的指针。返回值为 m_sync,类型为 void*。
参数
无
返回值
| 类型 | 描述 |
|---|---|
void* |
OpenGL GLsync 句柄。如果未调用过 Signal(),则返回 nullptr |
复杂度
O(1) - 常数时间
示例
OpenGLFence fence;
fence.Initialize(false);
fence.Signal();
void* handle = fence.GetNativeHandle();
if (handle != nullptr) {
// 可以传递给其他 OpenGL 函数
GLsync sync = static_cast<GLsync>(handle);
}
相关文档
- OpenGLFence 总览 - 返回类总览