X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=effect.h;h=f92201e6b40d56ab6812dac7669ce09da13f6a69;hb=bc5560403f4e43d1a32e5e8d94bca68922647779;hp=3585e2df9a168a0439d7da808471dd0871dee102;hpb=1b4302762db9cf76a29446fb4f7320b33db38e30;p=movit diff --git a/effect.h b/effect.h index 3585e2d..f92201e 100644 --- a/effect.h +++ b/effect.h @@ -6,6 +6,14 @@ #include +// Can alias on a float[2]. +struct Point2D { + Point2D(float x, float y) + : x(x), y(y) {} + + float x, y; +}; + // Can alias on a float[3]. struct RGBTriplet { RGBTriplet(float r, float g, float b) @@ -14,8 +22,9 @@ struct RGBTriplet { float r, g, b; }; -// Convenience functions that deal with prepending the prefix.. +// 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_vec2(GLhandleARB glsl_program_num, const std::string &prefix, const std::string &key, const float *values); void set_uniform_vec3(GLhandleARB glsl_program_num, const std::string &prefix, const std::string &key, const float *values); class Effect { @@ -33,17 +42,20 @@ public: // Neither of these take ownership. bool set_int(const std::string&, int value); bool set_float(const std::string &key, float value); + bool set_vec2(const std::string &key, const float *values); bool set_vec3(const std::string &key, const float *values); protected: // Neither of these take ownership. void register_int(const std::string &key, int *value); void register_float(const std::string &key, float *value); + void register_vec2(const std::string &key, float *values); void register_vec3(const std::string &key, float *values); private: std::map params_int; std::map params_float; + std::map params_vec2; std::map params_vec3; };