18 #ifndef ION_GFX_UNIFORMHOLDER_H_
19 #define ION_GFX_UNIFORMHOLDER_H_
48 uniforms_.push_back(uniform);
49 return uniforms_.size() - 1U;
58 if (uniform.
IsValid() && index < uniforms_.size()) {
59 uniforms_[index] = uniform;
70 const size_t index = GetUniformIndex(name);
73 uniforms_.erase(uniforms_.begin() + index);
87 if (index < uniforms_.size())
88 return uniforms_[index].SetValue(value);
98 if (index < uniforms_.size())
99 return uniforms_[index].SetValueAt(array_index, value);
108 size_t GetUniformIndex(
const std::string&
name)
const;
115 const size_t index = GetUniformIndex(name);
117 SetUniformValue<T>(index,
value);
128 const size_t index = GetUniformIndex(name);
131 uniforms_[index].SetValueAt(array_index, value);
137 void Enable(
bool enable) { is_enabled_ = enable; }
157 #endif // ION_GFX_UNIFORMHOLDER_H_
const size_t kInvalidIndex
kInvalidIndex is a size_t value that is very unlikely to be a valid index.
This class can be used in place of std::vector to allow an Ion Allocator to be used for memory alloca...