#[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.

C++ documentation:

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

source

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

C++ documentation:

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

source

pub unsafe fn rebind(&self)

Can be used to rebind the associated vertex array object.

Calls C++ function: void QOpenGLVertexArrayObject::Binder::rebind().

C++ documentation:

Can be used to rebind the associated vertex array object.

See also release().

source

pub unsafe fn release(&self)

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

Calls C++ function: void QOpenGLVertexArrayObject::Binder::release().

C++ documentation:

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

See also rebind().

Trait Implementations§

source§

impl CppDeletable for Binder

source§

unsafe fn delete(&self)

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

Calls C++ function: [destructor] void QOpenGLVertexArrayObject::Binder::~Binder().

C++ documentation:

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

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.