X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect.cpp;h=d0222dec91f936e662d5c82adb1c05ccf0eb4110;hp=8cdf236a1cad3f07e2a0b2645f22e23066f297b7;hb=e655afd53f2e56938bd4e7f72640eff56ef4a1ee;hpb=a93b0c94f68bf897adfdca95b292494497fa4f7f diff --git a/effect.cpp b/effect.cpp index 8cdf236..d0222de 100644 --- a/effect.cpp +++ b/effect.cpp @@ -1,5 +1,3 @@ -#define GL_GLEXT_PROTOTYPES 1 - #include #include #include @@ -7,8 +5,7 @@ #include "effect_chain.h" #include "util.h" -#include -#include +#include "opengl.h" GLint get_uniform_location(GLuint glsl_program_num, const std::string &prefix, const std::string &key) { @@ -170,11 +167,6 @@ void Effect::invalidate_1d_texture(const std::string &key) params_tex_1d[key].needs_update = true; } -void Effect::add_self_to_effect_chain(EffectChain *chain, const std::vector &inputs) -{ - chain->add_effect_raw(this, inputs); -} - // Output convenience uniforms for each parameter. // These will be filled in per-frame. std::string Effect::output_convenience_uniforms() const @@ -229,7 +221,7 @@ void Effect::set_gl_state(GLuint glsl_program_num, const std::string& prefix, un set_uniform_vec3(glsl_program_num, prefix, it->first, it->second); } - for (std::map::const_iterator it = params_tex_1d.begin(); + for (std::map::iterator it = params_tex_1d.begin(); it != params_tex_1d.end(); ++it) { glActiveTexture(GL_TEXTURE0 + *sampler_num); @@ -240,6 +232,7 @@ void Effect::set_gl_state(GLuint glsl_program_num, const std::string& prefix, un 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(); + it->second.needs_update = false; } set_uniform_int(glsl_program_num, prefix, it->first, *sampler_num);