![]() |
galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
|
OpenGL Shader storage buffer. More...
#include <ShaderBuffer.hpp>
Collaboration diagram for galaxy::ShaderBuffer:Public Member Functions | |
| ShaderBuffer () | |
| Constructor. | |
| ShaderBuffer (const GLBufferBinding index) | |
| Constructor. | |
| ShaderBuffer (ShaderBuffer &&) noexcept | |
| Move constructor. | |
| ShaderBuffer & | operator= (ShaderBuffer &&) noexcept |
| Move assignment operator. | |
| ~ShaderBuffer () | |
| Destructor. | |
| void | set_index (const GLBufferBinding index) |
| Set vertex shader binding point. | |
| template<typename Object > | |
| void | buffer (const unsigned int count, Object *data) |
| Buffer data. | |
| template<typename Object > | |
| void | sub_buffer (const unsigned int offset, const unsigned int count, Object *data) |
| Sub buffer data. | |
| void | bind () const |
| Bind buffer. | |
| void | unbind () const |
| Unbind buffer. | |
| void | clear () const |
| Clears data from buffer. | |
| void | destroy () |
| Destroy shader. | |
| unsigned int | id () const noexcept |
| Get OpenGL handle. | |
Private Member Functions | |
| ShaderBuffer (const ShaderBuffer &)=delete | |
| Copy constructor. | |
| ShaderBuffer & | operator= (const ShaderBuffer &)=delete |
| Copy assignment operator. | |
Private Attributes | |
| unsigned int | m_id |
| OpenGL handle. | |
| int | m_index |
| Index binding of SSBO in vertex shader. | |
OpenGL Shader storage buffer.
Definition at line 20 of file ShaderBuffer.hpp.
| galaxy::ShaderBuffer::ShaderBuffer | ( | ) |
Constructor.
You must call set_index() if you use default constructor.
Definition at line 14 of file ShaderBuffer.cpp.
| galaxy::ShaderBuffer::ShaderBuffer | ( | const GLBufferBinding | index | ) |
Constructor.
| index | Index binding that needs to match in vertex shader. |
Definition at line 21 of file ShaderBuffer.cpp.
|
noexcept |
Move constructor.
Definition at line 28 of file ShaderBuffer.cpp.
| galaxy::ShaderBuffer::~ShaderBuffer | ( | ) |
Destructor.
Definition at line 53 of file ShaderBuffer.cpp.
Here is the call graph for this function:
|
privatedelete |
Copy constructor.
|
noexcept |
Move assignment operator.
Definition at line 38 of file ShaderBuffer.cpp.
| void galaxy::ShaderBuffer::set_index | ( | const GLBufferBinding | index | ) |
Set vertex shader binding point.
| index | Index binding that needs to match in vertex shader. |
Definition at line 58 of file ShaderBuffer.cpp.
|
inline |
Buffer data.
| Object | The data structure to use with this buffer. |
| count | Number of objects in data. |
| data | Pointer to the data to buffer. |
Definition at line 134 of file ShaderBuffer.hpp.
Here is the call graph for this function:
|
inline |
Sub buffer data.
| Object | The data structure to use with this buffer. |
| offset | Offset to start adding buffer from. |
| count | Number of objects in data. |
| data | Pointer to the data to buffer. |
Definition at line 143 of file ShaderBuffer.hpp.
| void galaxy::ShaderBuffer::bind | ( | ) | const |
Bind buffer.
Definition at line 63 of file ShaderBuffer.cpp.
| void galaxy::ShaderBuffer::unbind | ( | ) | const |
Unbind buffer.
Definition at line 73 of file ShaderBuffer.cpp.
| void galaxy::ShaderBuffer::clear | ( | ) | const |
Clears data from buffer.
Definition at line 78 of file ShaderBuffer.cpp.
Here is the caller graph for this function:| void galaxy::ShaderBuffer::destroy | ( | ) |
Destroy shader.
Definition at line 86 of file ShaderBuffer.cpp.
Here is the caller graph for this function:
|
nodiscardnoexcept |
|
privatedelete |
Copy assignment operator.
|
private |
OpenGL handle.
Definition at line 125 of file ShaderBuffer.hpp.
|
private |
Index binding of SSBO in vertex shader.
Definition at line 130 of file ShaderBuffer.hpp.