X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect.h;h=3585e2df9a168a0439d7da808471dd0871dee102;hp=a7b0e4be0565a0375b0ed4231c3bf03e5894b75a;hb=affe96389941123d20354ad8091977aa196a741c;hpb=a88f299483ffe5068cd2828513078b9103325da8 diff --git a/effect.h b/effect.h index a7b0e4b..3585e2d 100644 --- a/effect.h +++ b/effect.h @@ -4,6 +4,8 @@ #include #include +#include + // Can alias on a float[3]. struct RGBTriplet { RGBTriplet(float r, float g, float b) @@ -12,6 +14,10 @@ struct RGBTriplet { float r, g, b; }; +// Convenience functions that deal with prepending the prefix.. +void set_uniform_float(GLhandleARB glsl_program_num, const std::string &prefix, const std::string &key, float value); +void set_uniform_vec3(GLhandleARB glsl_program_num, const std::string &prefix, const std::string &key, const float *values); + class Effect { public: virtual bool needs_linear_light() { return true; } @@ -19,6 +25,11 @@ public: virtual bool needs_many_samples() { return false; } virtual bool needs_mipmaps() { return false; } + virtual std::string output_convenience_uniforms(); + virtual std::string output_glsl() = 0; + + virtual void set_uniforms(GLhandleARB glsl_program_num, const std::string& prefix); + // Neither of these take ownership. bool set_int(const std::string&, int value); bool set_float(const std::string &key, float value);