Storage of UBO related data.
More...
#include <UniformBufferObject.hpp>
|
| UniformBufferObject ()=delete |
|
| UniformBufferObject (const char *UNIFORM_BLOCK_NAME, std::initializer_list< const char * > uniformNamesList) |
| Initializes the UniformBufferObject object.
|
|
| ~UniformBufferObject () |
| Deletes the UBO from the GPU and frees all memory on the CPU.
|
|
| UniformBufferObject (const UniformBufferObject &)=delete |
| do not allow UBOs to be copied
|
|
UniformBufferObject & | operator= (const UniformBufferObject &)=delete |
| do not allow UBOs to be copied
|
|
void | setupWithShaderProgram (ShaderProgram *shaderProgram, GLuint bindingPoint) |
| creates the UBO and allocates memory on both the CPU & GPU. binds the UBO and the uniform block for the provided ShaderProgram to the same binding point.
|
|
void | copyToOffset (unsigned int offset, void *addr, size_t len) |
| copies the value pointed to by addr to the corresponding location within the UBO as denoted by the offset
|
|
void | copyToBuffer (const char *UNIFORM_NAME, void *addr, size_t len) |
| copies the value pointed to by addr to the corresponding location within the UBO as denoted by the uniform name
|
|
void | bindBuffer () const |
| binds UBO object to UBO buffer
|
|
void | bufferSubData () const |
| transfers UBO data to UBO buffer
|
|
Storage of UBO related data.
◆ UniformBufferObject() [1/2]
CSCI441::UniformBufferObject::UniformBufferObject |
( |
| ) |
|
|
delete |
- Note
- must use `UniformBufferObject(const char*, std::initializer_list<const char*>
◆ UniformBufferObject() [2/2]
CSCI441::UniformBufferObject::UniformBufferObject |
( |
const char * |
UNIFORM_BLOCK_NAME, |
|
|
std::initializer_list< const char * > |
uniformNamesList |
|
) |
| |
|
inline |
Initializes the UniformBufferObject object.
- Parameters
-
UNIFORM_BLOCK_NAME | name of the uniform block |
uniformNamesList | list of names that makeup the uniform block components |
◆ copyToBuffer()
void CSCI441::UniformBufferObject::copyToBuffer |
( |
const char * |
UNIFORM_NAME, |
|
|
void * |
addr, |
|
|
size_t |
len |
|
) |
| |
|
inline |
copies the value pointed to by addr to the corresponding location within the UBO as denoted by the uniform name
- Parameters
-
UNIFORM_NAME | name of the uniform within the block to copy value to |
addr | starting address of source to copy from |
len | length of buffer to copy |
◆ copyToOffset()
void CSCI441::UniformBufferObject::copyToOffset |
( |
unsigned int |
offset, |
|
|
void * |
addr, |
|
|
size_t |
len |
|
) |
| |
|
inline |
copies the value pointed to by addr to the corresponding location within the UBO as denoted by the offset
- Parameters
-
offset | UBO offset to copy value to |
addr | starting address of source to copy from |
len | length of buffer to copy |
◆ setupWithShaderProgram()
void CSCI441::UniformBufferObject::setupWithShaderProgram |
( |
ShaderProgram * |
shaderProgram, |
|
|
GLuint |
bindingPoint |
|
) |
| |
|
inline |
creates the UBO and allocates memory on both the CPU & GPU. binds the UBO and the uniform block for the provided ShaderProgram to the same binding point.
- Parameters
-
shaderProgram | ShaderProgram object that utilizes the uniformBlock |
bindingPoint | Binding point to bind the UBO and ShaderProgram Uniform Block to |
The documentation for this class was generated from the following file: