![]() |
galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
|
Batches together vertex data to reduce draw calls. More...
#include <VertexBatch.hpp>
Collaboration diagram for galaxy::graphics::VertexBatch:Public Member Functions | |
| VertexBatch () | |
| Constructor. | |
| VertexBatch (VertexBatch &&) | |
| Move constructor. | |
| VertexBatch & | operator= (VertexBatch &&) |
| Move assignment operator. | |
| ~VertexBatch () | |
| Destructor. | |
| void | init (const int max_quads) |
| Initialize vertex batch data. | |
| int | push (std::span< Vertex > vertices) |
| Buffer some vertices into the spritebatch. | |
| void | sub_buffer (const unsigned int index, std::span< Vertex > vertices) |
| Sub-buffer vertex object. | |
| void | clear () |
| Clears out vertex buffer. | |
| VertexArray & | vao () |
| Get vertex array object. | |
Private Member Functions | |
| VertexBatch (const VertexBatch &)=delete | |
| Copy constructor. | |
| VertexBatch & | operator= (const VertexBatch &)=delete |
| Copy assignment operator. | |
Private Attributes | |
| VertexArray | m_vao |
| Vertex data. | |
| int | m_max_quads |
| Maximum quads allowed. | |
| int | m_index |
| Current index. | |
Batches together vertex data to reduce draw calls.
Usually used as part of other components, like a particle engine or map system.
Definition at line 22 of file VertexBatch.hpp.
| galaxy::graphics::VertexBatch::VertexBatch | ( | ) |
Constructor.
Definition at line 16 of file VertexBatch.cpp.
| galaxy::graphics::VertexBatch::VertexBatch | ( | VertexBatch && | s | ) |
Move constructor.
Definition at line 22 of file VertexBatch.cpp.
| galaxy::graphics::VertexBatch::~VertexBatch | ( | ) |
Destructor.
Definition at line 41 of file VertexBatch.cpp.
|
privatedelete |
Copy constructor.
| VertexBatch & galaxy::graphics::VertexBatch::operator= | ( | VertexBatch && | s | ) |
Move assignment operator.
Definition at line 29 of file VertexBatch.cpp.
| void galaxy::graphics::VertexBatch::init | ( | const int | max_quads | ) |
Initialize vertex batch data.
| max_quads | Number of quads to allow to be batched. |
Definition at line 45 of file VertexBatch.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| int galaxy::graphics::VertexBatch::push | ( | std::span< Vertex > | vertices | ) |
Buffer some vertices into the spritebatch.
| vertices | Vertex data to add to spritebatch buffer. |
Definition at line 75 of file VertexBatch.cpp.
Here is the call graph for this function:| void galaxy::graphics::VertexBatch::sub_buffer | ( | const unsigned int | index, |
| std::span< Vertex > | vertices ) |
Sub-buffer vertex object.
| index | Offset to start at. 0 = first vertex group (usually a group of 4 quads). |
| vertices | Vertices to assign. |
Definition at line 91 of file VertexBatch.cpp.
Here is the call graph for this function:| void galaxy::graphics::VertexBatch::clear | ( | ) |
Clears out vertex buffer.
Definition at line 96 of file VertexBatch.cpp.
Here is the call graph for this function:
|
nodiscard |
|
privatedelete |
Copy assignment operator.
|
private |
Vertex data.
Definition at line 98 of file VertexBatch.hpp.
|
private |
Maximum quads allowed.
Definition at line 103 of file VertexBatch.hpp.
|
private |
Current index.
Definition at line 108 of file VertexBatch.hpp.