Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QOpenGLVertexArrayObject::Binder Class Reference

The QOpenGLVertexArrayObject::Binder class is a convenience class to help with the binding and releasing of OpenGL Vertex Array Objects. More...

#include <qopenglvertexarrayobject.h>

+ Collaboration diagram for QOpenGLVertexArrayObject::Binder:

Public Member Functions

 Binder (QOpenGLVertexArrayObject *v)
 Creates a QOpenGLVertexArrayObject::Binder object and binds v by calling QOpenGLVertexArrayObject::bind().
 
 ~Binder ()
 Destroys the QOpenGLVertexArrayObject::Binder and releases the associated vertex array object.
 
void release ()
 Can be used to temporarily release the associated vertex array object.
 
void rebind ()
 Can be used to rebind the associated vertex array object.
 

Detailed Description

The QOpenGLVertexArrayObject::Binder class is a convenience class to help with the binding and releasing of OpenGL Vertex Array Objects.

\inmodule QtOpenGL \reentrant

Since
5.1

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().

See also
QOpenGLVertexArrayObject

Definition at line 33 of file qopenglvertexarrayobject.h.

Constructor & Destructor Documentation

◆ Binder()

QOpenGLVertexArrayObject::Binder::Binder ( QOpenGLVertexArrayObject * v)
inline

Creates a QOpenGLVertexArrayObject::Binder object and binds v by calling QOpenGLVertexArrayObject::bind().

If necessary it first calls QOpenGLVertexArrayObject::create().

Definition at line 36 of file qopenglvertexarrayobject.h.

References Q_ASSERT.

◆ ~Binder()

QOpenGLVertexArrayObject::Binder::~Binder ( )
inline

Destroys the QOpenGLVertexArrayObject::Binder and releases the associated vertex array object.

Definition at line 44 of file qopenglvertexarrayobject.h.

References release().

+ Here is the call graph for this function:

Member Function Documentation

◆ rebind()

QOpenGLVertexArrayObject::Binder::rebind ( )
inline

Can be used to rebind the associated vertex array object.

See also
release()

Definition at line 54 of file qopenglvertexarrayobject.h.

◆ release()

QOpenGLVertexArrayObject::Binder::release ( )
inline

Can be used to temporarily release the associated vertex array object.

See also
rebind()

Definition at line 49 of file qopenglvertexarrayobject.h.


The documentation for this class was generated from the following files: