- for (std::map<std::string, Texture1D>::const_iterator it = params_tex_1d.begin();
- it != params_tex_1d.end();
- ++it) {
- glActiveTexture(GL_TEXTURE0 + *sampler_num);
- check_error();
- glBindTexture(GL_TEXTURE_1D, it->second.texture_num);
- check_error();
-
- if (it->second.needs_update) {
- glTexImage1D(GL_TEXTURE_1D, 0, GL_LUMINANCE16F_ARB, it->second.size, 0, GL_LUMINANCE, GL_FLOAT, it->second.values);
- check_error();
- }
-
- set_uniform_int(glsl_program_num, prefix, it->first, *sampler_num);
- ++*sampler_num;
- }
+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);
+}
+
+void Effect::register_uniform_vec2_array(const std::string &key, const float *values, size_t num_values)
+{
+ Uniform<float> uniform;
+ uniform.name = key;
+ uniform.value = values;
+ uniform.num_values = num_values;
+ uniform.location = -1;
+ uniforms_vec2_array.push_back(uniform);