![]() |
galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
|
Abstraction for OpenGL vertex buffer objects. More...
#include <VertexBuffer.hpp>
Collaboration diagram for galaxy::VertexBuffer:Public Member Functions | |
| VertexBuffer () | |
| Constructor. | |
| VertexBuffer (VertexBuffer &&) noexcept | |
| Move constructor. | |
| VertexBuffer & | operator= (VertexBuffer &&) noexcept |
| Move assignment operator. | |
| ~VertexBuffer () | |
| Destructor. | |
| void | buffer (std::span< Vertex > vertices, std::span< unsigned int > indices) |
| Create vertex buffer. | |
| void | reserve (const int vertex_count, const int index_count) |
| Create vertex buffer without uploading. | |
| 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) const |
| Sub-buffer vertex buffer. | |
| void | sub_buffer_vertices (const unsigned int vi, const int vertex_size, const std::span< Vertex > vertices) const |
| Sub-buffer vertex buffer. | |
| void | sub_buffer_indices (const unsigned int ei, const int index_size, std::span< unsigned int > indices) const |
| Sub-buffer element/index buffer. | |
| void | erase (const unsigned int vi, const int vertex_count, const unsigned int ei, const int index_count) const |
| Erase a specfic segment of data. | |
| void | clear () const |
| Clear buffer data. | |
| int | count () const noexcept |
| Get the index count. | |
| void * | offset () noexcept |
| Gets index offset. | |
| unsigned int | id () const noexcept |
| Get OpenGL handle. | |
Private Member Functions | |
| VertexBuffer (const VertexBuffer &)=delete | |
| Copy constructor. | |
| VertexBuffer & | operator= (const VertexBuffer &)=delete |
| Copy assignment operator. | |
Private Attributes | |
| unsigned int | m_id |
| ID returned by OpenGL when generating buffer. | |
| std::size_t | m_offset |
| Index buffer offset. | |
| int | m_count |
| Index buffer count. | |
Abstraction for OpenGL vertex buffer objects.
Definition at line 20 of file VertexBuffer.hpp.
| galaxy::VertexBuffer::VertexBuffer | ( | ) |
Constructor.
Definition at line 14 of file VertexBuffer.cpp.
|
noexcept |
Move constructor.
Definition at line 22 of file VertexBuffer.cpp.
| galaxy::VertexBuffer::~VertexBuffer | ( | ) |
Destructor.
Definition at line 55 of file VertexBuffer.cpp.
|
privatedelete |
Copy constructor.
|
noexcept |
Move assignment operator.
Definition at line 36 of file VertexBuffer.cpp.
| void galaxy::VertexBuffer::buffer | ( | std::span< Vertex > | vertices, |
| std::span< unsigned int > | indices ) |
Create vertex buffer.
| vertices | Vertices to assign. |
| indices | Indices for vertex buffer. |
Definition at line 63 of file VertexBuffer.cpp.
Here is the caller graph for this function:| void galaxy::VertexBuffer::reserve | ( | const int | vertex_count, |
| const int | index_count ) |
Create vertex buffer without uploading.
| vertex_count | Number of vertices. |
| index_count | Number of indices. |
Definition at line 74 of file VertexBuffer.cpp.
Here is the caller graph for this function:| void galaxy::VertexBuffer::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 ) const |
Sub-buffer vertex buffer.
| vi | Offset to start at from initial vertices. 0 = first. |
| vertex_size | Amount of vertex data to sub buffer. |
| vertices | Vertices to assign. |
| ei | Offset to start at from initial indices. 0 = first. |
| index_size | Amount of index data to sub buffer. |
| indices | Indices to assign. |
Definition at line 85 of file VertexBuffer.cpp.
Here is the caller graph for this function:| void galaxy::VertexBuffer::sub_buffer_vertices | ( | const unsigned int | vi, |
| const int | vertex_size, | ||
| const std::span< Vertex > | vertices ) const |
Sub-buffer vertex buffer.
| vi | Offset to start at from initial vertices. 0 = first. |
| vertex_size | Amount of vertex data to sub buffer. |
| vertices | Vertices to assign. |
Definition at line 98 of file VertexBuffer.cpp.
Here is the caller graph for this function:| void galaxy::VertexBuffer::sub_buffer_indices | ( | const unsigned int | ei, |
| const int | index_size, | ||
| std::span< unsigned int > | indices ) const |
Sub-buffer element/index buffer.
| ei | Offset to start at from initial indices. 0 = first. |
| index_size | Amount of index data to sub buffer. |
| indices | Indices to assign. |
Definition at line 103 of file VertexBuffer.cpp.
Here is the caller graph for this function:| void galaxy::VertexBuffer::erase | ( | const unsigned int | vi, |
| const int | vertex_count, | ||
| const unsigned int | ei, | ||
| const int | index_count ) const |
Erase a specfic segment of data.
| vi | Offset to start at from initial vertices. 0 = first. |
| vertex_count | Number of vertices. |
| ei | Offset to start at from initial indices. 0 = first. |
| index_count | Number of indices. |
Definition at line 108 of file VertexBuffer.cpp.
Here is the caller graph for this function:| void galaxy::VertexBuffer::clear | ( | ) | const |
Clear buffer data.
Definition at line 114 of file VertexBuffer.cpp.
Here is the caller graph for this function:
|
nodiscardnoexcept |
Get the index count.
Definition at line 122 of file VertexBuffer.cpp.
Here is the caller graph for this function:
|
nodiscardnoexcept |
Gets index offset.
Definition at line 127 of file VertexBuffer.cpp.
Here is the caller graph for this function:
|
nodiscardnoexcept |
Get OpenGL handle.
Definition at line 132 of file VertexBuffer.cpp.
Here is the caller graph for this function:
|
privatedelete |
Copy assignment operator.
|
private |
ID returned by OpenGL when generating buffer.
Definition at line 149 of file VertexBuffer.hpp.
|
private |
Index buffer offset.
Definition at line 154 of file VertexBuffer.hpp.
|
private |
Index buffer count.
Definition at line 159 of file VertexBuffer.hpp.