X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=effect.h;h=fcb752638115dd6297bccb918cd606dd3b535645;hp=4191d4ddfb6714ec284719acae8c0e4b0f89b4bf;hb=b0f2d8f7604bfb4c8a9824a3a022d32ef26e12cc;hpb=f23c7768e6c13d6a719aaea89074d86b74148aeb diff --git a/effect.h b/effect.h index 4191d4d..fcb7526 100644 --- a/effect.h +++ b/effect.h @@ -16,6 +16,8 @@ #include +class EffectChain; + // Can alias on a float[2]. struct Point2D { Point2D(float x, float y) @@ -92,13 +94,16 @@ public: // needs mipmaps, you will also get them). virtual bool needs_mipmaps() const { return false; } + // How many inputs this effect will take (a fixed number). + // If you have only one input, it will be called INPUT() in GLSL; + // if you have several, they will be INPUT1(), INPUT2(), and so on. + virtual unsigned num_inputs() const { return 1; } + // Requests that this effect adds itself to the given effect chain. // For most effects, the default will be fine, but for effects that // consist of multiple passes, it is often useful to replace this // with something that adds completely different things to the chain. - virtual void add_self_to_effect_chain(std::vector *chain) { - chain->push_back(this); - } + virtual void add_self_to_effect_chain(EffectChain *graph, const std::vector &inputs); // Outputs one GLSL uniform declaration for each registered parameter // (see below), with the right prefix prepended to each uniform name.