\( \newcommand{\E}{\mathrm{E}} \) \( \newcommand{\A}{\mathrm{A}} \) \( \newcommand{\R}{\mathrm{R}} \) \( \newcommand{\N}{\mathrm{N}} \) \( \newcommand{\Q}{\mathrm{Q}} \) \( \newcommand{\Z}{\mathrm{Z}} \) \( \def\ccSum #1#2#3{ \sum_{#1}^{#2}{#3} } \def\ccProd #1#2#3{ \sum_{#1}^{#2}{#3} }\)
CGAL 5.0.2 - Three
CGAL::Three::Vbo Struct Reference

#include <CGAL/Three/Buffer_objects.h>

Definition

The Vbo struct is a wrapper for the QOpenGLBufferObject item.

It contains the data necessary for the rendering of any displayed entity. A Vbo can be shared between Vaos of the same context.

Public Member Functions

 Vbo (const char *attribute, Flag flag, QOpenGLBuffer::Type vbo_type=QOpenGLBuffer::VertexBuffer, GLenum data_type=GL_FLOAT, int offset=0, int tupleSize=3, int stride=0)
 Creates a Vbo. More...
 
bool bind ()
 Makes the Vbo active until release() is called.
 
void release ()
 Makes the Vbo and its program not active.
 
void allocate (void *data, int datasize)
 allocate gives CPU data to the GPU. More...
 

Constructor & Destructor Documentation

◆ Vbo()

CGAL::Three::Vbo::Vbo ( const char *  attribute,
Flag  flag,
QOpenGLBuffer::Type  vbo_type = QOpenGLBuffer::VertexBuffer,
GLenum  data_type = GL_FLOAT,
int  offset = 0,
int  tupleSize = 3,
int  stride = 0 
)

Creates a Vbo.

Parameters
attributethe name of the corresponding data in the shader.
flagthe flag that specifies which type of data this corresponds to.
vbo_typeis almost always QOpenGLBuffer::VertexBuffer but can be QOpenGLBuffer::IndexBuffer if it contains the indices for an indexed rendering.
data_typethe GL data type. Mostly GL_FLOAT.
offsetthe offset in the buffer. See OpenGL documentation.
tupleSizethe size of the tuple. If it contains vector_3s, then tuple_size is 3.
stridethe stride for the buffer. See OpenGL documentation.
Attention
This must be called within a valid OpenGLContext. Most of the time, initGL() functions are safe places to do so.

Member Function Documentation

◆ allocate()

void CGAL::Three::Vbo::allocate ( void *  data,
int  datasize 
)

allocate gives CPU data to the GPU.

Parameters
datathe content of the buffer.
datasizethe number of bytes in data.