- class Binder¶
The
Binder
class is a convenience class to help with the binding and releasing of OpenGL Vertex Array Objects. More…Synopsis¶
Methods¶
def
__init__()
def
__enter__()
def
__exit__()
def
rebind()
def
release()
Note
This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE
Detailed Description¶
Binder
is a simple convenience class that can be used to assist with the binding and releasing ofQOpenGLVertexArrayObject
instances. This class is toQOpenGLVertexArrayObject
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, callingcreate()
if necessary. The destructor of this class callsrelease()
which unbinds the VAO.If needed the VAO can be temporarily unbound with the
release()
function and bound once more withrebind()
.See also
- __init__(v)¶
- Parameters:
Creates a
Binder
object and bindsv
by callingbind()
. If necessary it first callscreate()
.- __enter__()¶
- Return type:
Binder
- __exit__(arg__1, arg__2, arg__3)¶
- Parameters:
arg__1 – object
arg__2 – object
arg__3 – object
- rebind()¶
Can be used to rebind the associated vertex array object.
See also
release()
- release()¶
Can be used to temporarily release the associated vertex array object.
See also
rebind()