8#ifndef GALAXY_GRAPHICS_GL_VERTEXARRAY_HPP_
9#define GALAXY_GRAPHICS_GL_VERTEXARRAY_HPP_
55 void reserve(
const int vertex_count,
const int index_count);
68 sub_buffer(
const unsigned int vi,
const int vertex_size,
const std::span<Vertex>
vertices,
const unsigned int ei,
const int index_size, std::span<unsigned int>
indices);
96 void erase(
const unsigned int vi,
const int vertex_count,
const unsigned int ei,
const int index_count);
119 int count()
const noexcept;
143 unsigned int id()
const noexcept;
thread_local const float vertices[]
Video.cpp galaxy.
thread_local const unsigned int indices[]
Abstraction for OpenGL vertex array objects.
VertexArray()
Constructor.
void bind() const
Bind this vertex array.
~VertexArray()
Destructor.
VertexBuffer m_vbo
Vertex buffer.
VertexArray(const VertexArray &)=delete
Copy constructor.
VertexBuffer & vbo() noexcept
Get vertex buffer.
void buffer(std::span< Vertex > vertices, std::span< unsigned int > indices)
Create vertex buffer.
void sub_buffer(const unsigned int vi, const int vertex_size, const std::span< Vertex > vertices, const unsigned int ei, const int index_size, std::span< unsigned int > indices)
Sub-buffer vertex buffer.
int count() const noexcept
Get the index count.
void sub_buffer_indices(const unsigned int ei, const int index_size, std::span< unsigned int > indices) const
Sub-buffer element/index buffer.
VertexArray & operator=(VertexArray &&) noexcept
Move assignment operator.
void erase(const unsigned int vi, const int vertex_count, const unsigned int ei, const int index_count)
Erase a specfic segment of data.
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.
void clear()
Clear buffer data.
void reserve(const int vertex_count, const int index_count)
Create vertex buffer without uploading.
void sub_buffer_vertices(const unsigned int vi, const int vertex_size, const std::span< Vertex > vertices) const
Sub-buffer vertex buffer.
VertexArray & operator=(const VertexArray &)=delete
Copy assignment operator.
Abstraction for OpenGL vertex buffer objects.