8#include <glm/mat4x4.hpp>
20 glCreateVertexArrays(1, &
m_id);
27 glDeleteVertexArrays(1, &this->m_id);
31 this->m_vbo = std::move(v.m_vbo);
42 glDeleteVertexArrays(1, &this->m_id);
46 this->m_vbo = std::move(v.m_vbo);
58 glDeleteVertexArrays(1, &
m_id);
110 glBindVertexArray(
m_id);
115 glBindVertexArray(0);
thread_local const float vertices[]
Video.cpp galaxy.
Abstraction for OpenGL vertex array objects.
VertexArray()
Constructor.
void sub_buffer(const unsigned int index, std::span< Vertex > vertices)
Sub-buffer vertex array.
void bind() const
Bind this vertex array.
~VertexArray()
Destructor.
VertexBuffer m_vbo
Vertex buffer.
VertexBuffer & vbo() noexcept
Get vertex buffer.
int count() const noexcept
Get the index count.
void buffer(std::span< Vertex > vertices, std::span< unsigned int > indicies)
Create vertex array object.
VertexArray & operator=(VertexArray &&) noexcept
Move assignment operator.
void unbind() const
Unbind this vertex array.
unsigned int m_id
VAO object.
unsigned int id() const noexcept
Get vertex array handle.
void * offset() noexcept
Gets index offset.
Abstraction for OpenGL vertex buffer objects.
void buffer(std::span< Vertex > vertices, std::span< unsigned int > indicies)
Create vertex buffer object.
int count() const noexcept
Get the index count.
void * offset() noexcept
Gets index offset.
void sub_buffer(const unsigned int index, std::span< Vertex > vertices)
Sub-buffer vertex object.
unsigned int id() const noexcept
Get OpenGL handle.
@ POSITION_POINT
Position data.
@ VERTEX_BUFFER_POINT
Normal VBO.
Represents a single vertex point.