CGPdocs

opengl_ebo_structure

OpenGL element buffer (EBO) holding the triangle indices (uint3) of an indexed mesh.

Derives from: opengl_gpu_buffer

module 13_openglsource: ebo.hpp

Fields and methods

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

Methods

Allocates a new EBO (glBufferData on GL_ELEMENT_ARRAY_BUFFER, GL_DYNAMIC_DRAW) holding the triangle indices and stores its id and size (number of triangles); prints a warning if the EBO was already allocated, whose memory is then lost. src
Inherited from opengl_gpu_buffer (7 members)

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_ebo_structure

None.

Functions returning a opengl_ebo_structure

None.

Operators

None.

CGP - Computer Graphics Programming.