Struct qt_gui::q_opengl_vertex_array_object::Binder
source · #[repr(C)]pub struct Binder { /* private fields */ }
Expand description
The QOpenGLVertexArrayObject::Binder class is a convenience class to help with the binding and releasing of OpenGL Vertex Array Objects.
C++ class: QOpenGLVertexArrayObject::Binder
.
The QOpenGLVertexArrayObject::Binder class is a convenience class to help with the binding and releasing of OpenGL Vertex Array Objects.
QOpenGLVertexArrayObject::Binder is a simple convenience class that can be used to assist with the binding and releasing of QOpenGLVertexArrayObject instances. This class is to QOpenGLVertexArrayObject as QMutexLocker is to QMutex.
This class implements the RAII principle which helps to ensure behavior in complex code or in the presence of exceptions.
The constructor of this class accepts a QOpenGLVertexArrayObject (VAO) as an argument and attempts to bind the VAO, calling QOpenGLVertexArrayObject::create() if necessary. The destructor of this class calls QOpenGLVertexArrayObject::release() which unbinds the VAO.
If needed the VAO can be temporarily unbound with the release() function and bound once more with rebind().
Implementations§
source§impl Binder
impl Binder
sourcepub unsafe fn new(
v: impl CastInto<Ptr<QOpenGLVertexArrayObject>>
) -> CppBox<Binder>
pub unsafe fn new( v: impl CastInto<Ptr<QOpenGLVertexArrayObject>> ) -> CppBox<Binder>
Creates a QOpenGLVertexArrayObject::Binder object and binds v by calling QOpenGLVertexArrayObject::bind(). If necessary it first calls QOpenGLVertexArrayObject::create().
Calls C++ function: [constructor] void QOpenGLVertexArrayObject::Binder::Binder(QOpenGLVertexArrayObject* v)
.
Creates a QOpenGLVertexArrayObject::Binder object and binds v by calling QOpenGLVertexArrayObject::bind(). If necessary it first calls QOpenGLVertexArrayObject::create().
sourcepub unsafe fn rebind(&self)
pub unsafe fn rebind(&self)
Can be used to rebind the associated vertex array object.
Calls C++ function: void QOpenGLVertexArrayObject::Binder::rebind()
.
Can be used to rebind the associated vertex array object.
See also release().
Trait Implementations§
source§impl CppDeletable for Binder
impl CppDeletable for Binder
source§unsafe fn delete(&self)
unsafe fn delete(&self)
Destroys the QOpenGLVertexArrayObject::Binder and releases the associated vertex array object.
Calls C++ function: [destructor] void QOpenGLVertexArrayObject::Binder::~Binder()
.
Destroys the QOpenGLVertexArrayObject::Binder and releases the associated vertex array object.