engine::graphics::BufferUtils struct

A collection of functions to reduce OpenGL boilerplate related to buffers.

Public static functions

static void CreateBasicBuffers(unsigned int& vao, unsigned int& vbo, unsigned int& ebo, size_t vbo_size)
Creates and binds a VAO, VBO, and EBO in one go leaving VAO bound.
static void SetAttribute(unsigned int index, int size, size_t stride, size_t offset)
Defines a float vertex attribute pointer.

Function documentation

static void engine::graphics::BufferUtils::CreateBasicBuffers(unsigned int& vao, unsigned int& vbo, unsigned int& ebo, size_t vbo_size)

Creates and binds a VAO, VBO, and EBO in one go leaving VAO bound.

Parameters
vao Reference to store the VAO ID.
vbo Reference to store the VBO ID.
ebo Reference to store the EBO ID.
vbo_size Size of the VBO in bytes.

static void engine::graphics::BufferUtils::SetAttribute(unsigned int index, int size, size_t stride, size_t offset)

Defines a float vertex attribute pointer.

Parameters
index Attribute index.
size Number of components.
stride Stride between vertices.
offset Offset of the attribute.