Kanzi  3.9.6
Kanzi Engine API
kanzi::GLBufferHandle Class Reference

GLBufferHandle manages RAII ownership for GL buffer object. More...

#include <kanzi/core.ui/platform/graphics_backend/gl/gl_buffer_handle.hpp>

Public Member Functions

unsigned int get () const
 Returns GL handle to the buffer object, or 0 if no GL buffer is owned. More...
 
 GLBufferHandle ()
 Constructs an empty GLBufferHandle which does not own any GL buffer object. More...
 
 GLBufferHandle (Renderer *renderer)
 Creates a GL buffer object with renderer and constructs a GLBufferHandle that owns the GL buffer object. More...
 
 GLBufferHandle (Renderer *renderer, unsigned int handle, bool takeOwnership)
 Creates a wrapper for an existing GL buffer object. More...
 
 GLBufferHandle (GLBufferHandle &&other)
 
 operator bool_type () const
 
GLBufferHandleoperator= (GLBufferHandle &&other)
 
unsigned int release ()
 Releases the ownership of the GL buffer if any. More...
 
void reset ()
 Destroys the GL buffer object currently managed by the GLBufferHandle (if any) More...
 
 ~GLBufferHandle ()
 

Friends

void swap (GLBufferHandle &left, GLBufferHandle &right)
 

Detailed Description

GLBufferHandle manages RAII ownership for GL buffer object.

Constructor & Destructor Documentation

◆ GLBufferHandle() [1/4]

kanzi::GLBufferHandle::GLBufferHandle ( )
explicit

Constructs an empty GLBufferHandle which does not own any GL buffer object.

◆ GLBufferHandle() [2/4]

kanzi::GLBufferHandle::GLBufferHandle ( Renderer renderer)
explicit

Creates a GL buffer object with renderer and constructs a GLBufferHandle that owns the GL buffer object.

Parameters
rendererRenderer

◆ ~GLBufferHandle()

kanzi::GLBufferHandle::~GLBufferHandle ( )

◆ GLBufferHandle() [3/4]

kanzi::GLBufferHandle::GLBufferHandle ( Renderer renderer,
unsigned int  handle,
bool  takeOwnership 
)
explicit

Creates a wrapper for an existing GL buffer object.

Parameters
rendererThe renderer.
handleThe name of an existing GL buffer object.
takeOwnershipWhether the created GLBufferHandle takes ownership of the GL buffer object. When set to false, Kanzi does not delete the GL buffer object when destroying the GLBufferHandle.

◆ GLBufferHandle() [4/4]

kanzi::GLBufferHandle::GLBufferHandle ( GLBufferHandle &&  other)
inline

Member Function Documentation

◆ release()

unsigned int kanzi::GLBufferHandle::release ( )

Releases the ownership of the GL buffer if any.

get() returns 0 after the call.

Returns
Handle to the GL buffer object

◆ operator=()

GLBufferHandle& kanzi::GLBufferHandle::operator= ( GLBufferHandle &&  other)
inline

◆ get()

unsigned int kanzi::GLBufferHandle::get ( ) const
inline

Returns GL handle to the buffer object, or 0 if no GL buffer is owned.

◆ reset()

void kanzi::GLBufferHandle::reset ( )

Destroys the GL buffer object currently managed by the GLBufferHandle (if any)

◆ operator bool_type()

kanzi::GLBufferHandle::operator bool_type ( ) const
inline

Friends And Related Function Documentation

◆ swap

void swap ( GLBufferHandle left,
GLBufferHandle right 
)
friend

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