Class vertexarray

Class Documentation

class legion::rendering::vertexarray

Low level vertexarray object.


Read more at wiki.

Public Functions

vertexarray() = default

Faux constructor. To prevent unnecessary GPU allocations the default constructor doesn’t actually create a VAO. This means that default initialized vertexarrays are invalid temporary objects until they get properly initialized.

explicit vertexarray([[maybe_unused]] std::nullptr_t t)

Main allocating constructor. This constructor actually creates the GPU side renderbuffer.

  • t: temporary message value that tells the compiler to use the right constructor.

void setAttribPointer(const buffer &buf, uint index, size_type size, GLenum type, bool normalized, size_type stride, size_type offset)
void setAttribDivisor(uint index, uint divisor)
void bind() const

Bind the vertexarray to the current context. Useful for low level native rendering.

Public Static Functions

static vertexarray generate()

Static function to generate a VAO. Alternative to the vertexarray(std::nullptr_t) constructor.


vertexarray Newly created VAO.

static void release()

Release the vertexarray from the current context. Useful for low level native rendering.