IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Binder Class

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

This class was introduced in Qt 5.1.

All functions in this class are reentrant.

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

Binder Class

  • Header: Binder

  • Since: Qt 5.1

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS OpenGL)

    target_link_libraries(mytarget PRIVATE Qt6::OpenGL)

  • qmake: QT += opengl

  • Group: Binder is part of painting-3D

Detailed Description

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

Member Function Documentation

 

Binder::Binder(QOpenGLVertexArrayObject *v)

Creates a QOpenGLVertexArrayObject::Binder object and binds v by calling QOpenGLVertexArrayObject::bind(). If necessary it first calls QOpenGLVertexArrayObject::create().

Binder::~Binder()

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

void Binder::rebind()

Can be used to rebind the associated vertex array object.

See Also

See also release()

void Binder::release()

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

See Also

See also rebind()

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+