QOpenGLVertexArrayObject::Binder Class
class QOpenGLVertexArrayObject::BinderQOpenGLVertexArrayObject::Binder 类是一个便利类,用于帮助绑定和释放 OpenGL 顶点阵列对象。更多
- 所有成员(包括继承成员)的列表
- 绑定器是3D 渲染的一部分。
注意:该类中的所有函数都是可重入的。
公共函数
详细说明
QOpenGLVertexArrayObject::Binder 是一个简单的便利类,可用于协助绑定和释放 实例。该类与 的关系就像 与 的关系一样。QOpenGLVertexArrayObject QOpenGLVertexArrayObject QMutexLocker QMutex
该类实现了 RAII 原则,有助于确保复杂代码或出现异常时的行为。
该类的构造函数接受QOpenGLVertexArrayObject (VAO) 作为参数,并尝试绑定 VAO,必要时调用QOpenGLVertexArrayObject::create() 。该类的析构函数会调用QOpenGLVertexArrayObject::release() 来解除 VAO 的绑定。
另请参阅 QOpenGLVertexArrayObject 。
成员函数文档
Binder::Binder(QOpenGLVertexArrayObject *v)
创建QOpenGLVertexArrayObject::Binder 对象,并通过调用QOpenGLVertexArrayObject::bind() 绑定v 。如有必要,它会首先调用QOpenGLVertexArrayObject::create().
[noexcept]
Binder::~Binder()
销毁QOpenGLVertexArrayObject::Binder 并释放相关顶点数组对象。
void Binder::rebind()
可用于重新绑定相关的顶点数组对象。
另请参阅 release().
void Binder::release()
可用于临时释放相关顶点阵列对象。
另请参见 rebind().
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.