void glGenBuffers(GLsizei n, GLuint *buffers)
n buffers stored in VRAM on the GPU.void glBindBuffer(GLenum target, GLuint buffer)
the buffer, making it active. The target is GL_ARRAY_BUFFER
void glBufferData(GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
be used to fill the currently bound buffer.
However, if data is NULL, no data is copied – instead, the buffer is
void glBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data)
used to replace part of the previously allocated buffer. The data will be copied at offset bytes in
void glEnableVertexAttribArray(GLuint index)
a generic vertex attribute arrays. We
will use one for position and another for colour. This is so the vertex shader knows where to
find the position and colours in the array.
void glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalised, GLsizei stride, const GLvoid* pointer)
where the vertex attributes (positions, colours) are located in the array. Size is the number of attributes per
vertex. When stride is 0 since the
attributes are tightly