]> git.tdb.fi Git - libs/gl.git/blob - source/effect.h
Add a method of getting the model matrix of a Renderable
[libs/gl.git] / source / effect.h
1 #ifndef MSP_GL_EFFECT_H_
2 #define MSP_GL_EFFECT_H_
3
4 #include <set>
5 #include "renderable.h"
6
7 namespace Msp {
8 namespace GL {
9
10 /**
11 Effects are used to wrap other renderables and give them additional visual
12 properties.  An Effect's render method should set up the necessary state, call
13 the wrapped Renderable's render method, and clean up after itself.
14 */
15 class Effect: public Renderable
16 {
17 protected:
18         const Renderable &renderable;
19         std::set<Tag> enabled_passes;
20
21         Effect(const Renderable &);
22 public:
23         virtual ~Effect() { }
24
25         void enable_for_pass(const Tag &);
26         void disable_for_pass(const Tag &);
27
28         virtual const Matrix *get_matrix() const { return renderable.get_matrix(); }
29 };
30
31 } // namespace GL
32 } // namespace Msp
33
34 #endif