#include <uniforminstance.h>
Public Member Functions | |
TypedUniformValueArrayInstance (const ShaderVariableValueArrayDeclaration &declaration) | |
void | set (const TypedUniformValueArray< T > &resource) |
void | setValues (const std::vector< T > &values) |
void | setValue (T value, int index) |
virtual void | setDefault () override |
int | getNumElements () const |
std::vector< T > & | getValues () |
virtual void | push (uint8 *uniformBuffer) const override |
T & | operator[] (size_t index) |
![]() | |
UniformValueArrayInstance (const ShaderVariableValueArrayDeclaration &declaration) | |
virtual const ShaderVariableDeclaration & | getDeclaration () const override |
int | getMaxNumElements () const |
![]() | |
virtual | ~UniformInstance ()=default |
Additional Inherited Members | |
![]() | |
const ShaderVariableValueArrayDeclaration * | mDeclaration |
Specific type of uniform value array instance, for example: std::vector<float> -> TypedUniformValueArrayInstance<float>. All supported types are defined below for easier readability.
TypedUniformValueArrayInstance | ( | const ShaderVariableValueArrayDeclaration & | declaration | ) |
int getNumElements | ( | ) | const |
std::vector<T>& getValues | ( | ) |
T& operator[] | ( | size_t | index | ) |
Array subscript operator, returns a specific value in the array as a reference, making the following possible: mUniformArray[0] = 12
;
|
overridevirtual |
Pushes the data to the 'Shader'
uniformBuffer | the buffer to copy the array into. |
Implements UniformLeafInstance.
void set | ( | const TypedUniformValueArray< T > & | resource | ) |
Updates the uniform value from a resource, data is not pushed immediately.
resource | resource to copy data from. |
|
overridevirtual |
Resize based on shader declaration.
Implements UniformValueArrayInstance.
void setValue | ( | T | value, |
int | index | ||
) |
Updates a single uniform value in the array, data is not pushed immediately. Note that the given index must be =< than length declared in shader.
value | the value to set |
index | the index in the array |
void setValues | ( | const std::vector< T > & | values | ) |
Updates the uniform value, data is not pushed immediately. Note that the length of the given values must be =< than length declared in shader.
values | new list of values |