- for (std::map<std::string, float*>::const_iterator it = params_float.begin();
- it != params_float.end();
- ++it) {
- set_uniform_float(glsl_program_num, prefix, it->first, *it->second);
- }
- for (std::map<std::string, float*>::const_iterator it = params_vec3.begin();
- it != params_vec3.end();
- ++it) {
- set_uniform_vec3(glsl_program_num, prefix, it->first, it->second);
- }
+ Uniform<int> uniform;
+ uniform.name = key;
+ uniform.value = value;
+ uniform.num_values = 1;
+ uniform.location = -1;
+ uniforms_sampler2d.push_back(uniform);
+}
+
+void Effect::register_uniform_bool(const std::string &key, const bool *value)
+{
+ Uniform<bool> uniform;
+ uniform.name = key;
+ uniform.value = value;
+ uniform.num_values = 1;
+ uniform.location = -1;
+ uniforms_bool.push_back(uniform);
+}
+
+void Effect::register_uniform_int(const std::string &key, const int *value)
+{
+ Uniform<int> uniform;
+ uniform.name = key;
+ uniform.value = value;
+ uniform.num_values = 1;
+ uniform.location = -1;
+ uniforms_int.push_back(uniform);
+}
+
+void Effect::register_uniform_float(const std::string &key, const float *value)
+{
+ Uniform<float> uniform;
+ uniform.name = key;
+ uniform.value = value;
+ uniform.num_values = 1;
+ uniform.location = -1;
+ uniforms_float.push_back(uniform);
+}
+
+void Effect::register_uniform_vec2(const std::string &key, const float *values)
+{
+ Uniform<float> uniform;
+ uniform.name = key;
+ uniform.value = values;
+ uniform.num_values = 1;
+ uniform.location = -1;
+ uniforms_vec2.push_back(uniform);
+}
+
+void Effect::register_uniform_vec3(const std::string &key, const float *values)
+{
+ Uniform<float> uniform;
+ uniform.name = key;
+ uniform.value = values;
+ uniform.num_values = 1;
+ uniform.location = -1;
+ uniforms_vec3.push_back(uniform);
+}
+
+void Effect::register_uniform_vec4(const std::string &key, const float *values)
+{
+ Uniform<float> uniform;
+ uniform.name = key;
+ uniform.value = values;
+ uniform.num_values = 1;
+ uniform.location = -1;
+ uniforms_vec4.push_back(uniform);