8#ifndef GALAXY_GRAPHICS_VERTEXBATCH_HPP_
9#define GALAXY_GRAPHICS_VERTEXBATCH_HPP_
30 VertexBatch(
const int max,
const int vertex_count,
const std::vector<unsigned int>&
indices)
noexcept;
62 void flush()
noexcept;
67 void bind()
const noexcept;
75 int count()
const noexcept;
thread_local const float vertices[]
Video.cpp galaxy.
thread_local const unsigned int indices[]
Abstraction for OpenGL vertex array objects.
A group of vertices for multiple renderables batched together.
int m_vertex_length
Total number of vertices.
int m_vertex_count
Amount of vertices to flush.
void bind() const noexcept
Bind this batchs vertex array object.
VertexBatch()=delete
Constructor.
int m_index_count
Amount of indices per renderable.
int m_index_length
Total number of indices.
std::vector< Vertex > m_vertices
CPU side reserved vertices.
VertexArray m_vao
VAO object for GPU data.
void push(const std::vector< Vertex > &vertices) noexcept
Add vertex and index data to batch.
VertexBatch & operator=(VertexBatch &&) noexcept
Move assignment operator.
void flush() noexcept
Copy all data to GPU.
VertexBatch(const VertexBatch &)=delete
Copy constructor.
int count() const noexcept
Get the index count.
void prepare() noexcept
Sets up counters to begin pushing vertices.
~VertexBatch() noexcept
Destructor.
int m_count
Amount of renderables to draw.
void * offset() noexcept
Gets index offset.
VertexArray & vao() noexcept
Gets internal VAO.
VertexBatch & operator=(const VertexBatch &)=delete
Copy assignment operator.