![]() |
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 <InstanceBuffer.hpp>
Public Member Functions | |
InstanceBuffer () | |
Constructor. | |
InstanceBuffer (InstanceBuffer &&) | |
Move constructor. | |
InstanceBuffer & | operator= (InstanceBuffer &&) |
Move assignment operator. | |
~InstanceBuffer () | |
Destructor. | |
void | buffer (std::span< glm::mat4 > transforms) |
Create instance buffer. | |
void | sub_buffer (const unsigned int index, std::span< glm::mat4 > transforms) |
Sub-buffer instances. | |
void | clear () |
Clear buffer data. | |
int | amount () const |
Get the amount of instances. | |
unsigned int | id () const |
Get OpenGL handle. | |
Private Member Functions | |
InstanceBuffer (const InstanceBuffer &)=delete | |
Copy constructor. | |
InstanceBuffer & | operator= (const InstanceBuffer &)=delete |
Copy assignment operator. | |
Private Attributes | |
unsigned int | m_id |
ID returned by OpenGL when generating buffer. | |
int | m_amount |
Number of instances. | |
Abstraction for OpenGL vertex buffer objects.
Definition at line 22 of file InstanceBuffer.hpp.
galaxy::graphics::InstanceBuffer::InstanceBuffer | ( | ) |
Constructor.
Definition at line 17 of file InstanceBuffer.cpp.
galaxy::graphics::InstanceBuffer::InstanceBuffer | ( | InstanceBuffer && | i | ) |
Move constructor.
Definition at line 24 of file InstanceBuffer.cpp.
galaxy::graphics::InstanceBuffer::~InstanceBuffer | ( | ) |
Destructor.
Definition at line 45 of file InstanceBuffer.cpp.
|
privatedelete |
Copy constructor.
InstanceBuffer & galaxy::graphics::InstanceBuffer::operator= | ( | InstanceBuffer && | i | ) |
Move assignment operator.
Definition at line 32 of file InstanceBuffer.cpp.
void galaxy::graphics::InstanceBuffer::buffer | ( | std::span< glm::mat4 > | transforms | ) |
Create instance buffer.
transforms | Transform to apply to each instance. |
Definition at line 53 of file InstanceBuffer.cpp.
void galaxy::graphics::InstanceBuffer::sub_buffer | ( | const unsigned int | index, |
std::span< glm::mat4 > | transforms ) |
Sub-buffer instances.
index | Offset to start from. 0 = first element. |
transforms | Transforms to upload. |
Definition at line 59 of file InstanceBuffer.cpp.
void galaxy::graphics::InstanceBuffer::clear | ( | ) |
Clear buffer data.
Definition at line 64 of file InstanceBuffer.cpp.
|
nodiscard |
Get the amount of instances.
Definition at line 69 of file InstanceBuffer.cpp.
|
nodiscard |
Get OpenGL handle.
Definition at line 74 of file InstanceBuffer.cpp.
|
privatedelete |
Copy assignment operator.
|
private |
ID returned by OpenGL when generating buffer.
Definition at line 95 of file InstanceBuffer.hpp.
|
private |
Number of instances.
Definition at line 100 of file InstanceBuffer.hpp.