CGPdocs

opengl_gpu_buffer

Common base of the VBO and the EBO - OpenGL id, number of elements, target and memory layout.

Fields and methods

Members of the struct opengl_gpu_buffer. Most of what you do with a CGP type goes through the free functions listed below.

Fields

GLuint id = 0OpenGL id of the buffer, 0 when it is not allocated.
GLuint size = 0Number of elements in the buffer (a vec3 or a uint3 counts as one element), 0 when empty.
GLenum type = 0OpenGL target of the buffer, GL_ARRAY_BUFFER for a VBO and GL_ELEMENT_ARRAY_BUFFER for an EBO.
opengl_gpu_buffer_details detailsAllocated size in bytes, number of components per element (2, 3 or 4) and component type (GL_FLOAT), used to describe the buffer to the VAO.

Methods

Binds the buffer to its target (glBindBuffer) when its id is not 0. src
Unbinds any buffer from the target of this buffer (glBindBuffer with 0). src
Deletes the buffer on the GPU (glDeleteBuffers) and resets id, size, type and details to 0. src

Functions taking a opengl_gpu_buffer

None.

Functions returning a opengl_gpu_buffer

None.

Operators

None.

CGP - Computer Graphics Programming.