![]() |
GLW
Computer Graphics Structures library
|
Object to store global variables, arrays or structures and manipulate them. Type of elements inside the buffer must be defined as template type. More...
Public Member Functions | |
| UniformBuffer () | |
| Register new buffer to video memory. | |
| ~UniformBuffer () | |
| Free buffer from video memory. | |
| uint32_t | Size () |
| Get number of elements in currently allocated buffer. | |
| void | Resize (const uint32_t size) |
| Allocate new buffer with specified number of elements, copies old buffer data to newly created one. | |
| void | Reset (const std::vector< T > &data) |
| void | Bind (uint32_t index) |
| Bind this buffer onto specified shader location. | |
| void | SetData (const std::vector< T > &data, const uint32_t position=0u) |
| void | SetData (const T &data, const uint32_t position=0) |
Object to store global variables, arrays or structures and manipulate them. Type of elements inside the buffer must be defined as template type.
| void glw::UniformBuffer< T >::Reset | ( | const std::vector< T > & | data | ) |
Deletes all previously allocated data, resizes buffer to the size of provided data, and stores defined data inside buffer.
| void glw::UniformBuffer< T >::SetData | ( | const std::vector< T > & | data, |
| const uint32_t | position = 0u |
||
| ) |
Set array of data elements into the buffer at defined position. Does not change the size of buffer. When data vector should be written outside buffer, outlaying data is ignored.
| void glw::UniformBuffer< T >::SetData | ( | const T & | data, |
| const uint32_t | position = 0 |
||
| ) |
Set single data element into the buffer at defined position. Does not change the size of buffer. When data should be written outside buffer, writing is ignored.