3 This file is part of libmspgl
4 Copyright © 2009-2011 Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
8 #ifndef MSP_GL_PIPELINE_H_
9 #define MSP_GL_PIPELINE_H_
13 #include "pipelinepass.h"
14 #include "renderable.h"
26 class Pipeline: public Renderable
31 const Renderable *renderable;
34 Slot(const Renderable *);
37 typedef std::map<Tag, PipelinePass> PassMap;
40 std::vector<Tag> pass_order;
42 std::vector<Slot> renderables;
43 std::vector<Effect *> effects;
44 std::vector<PostProcessor *> postproc;
53 Renderbuffer *color_buf_ms;
54 Renderbuffer *depth_buf_ms;
57 Pipeline(unsigned, unsigned, bool = false);
61 void set_multisample(unsigned);
62 void set_camera(const Camera *);
64 PipelinePass &add_pass(const Tag &tag);
65 PipelinePass &get_pass(const Tag &tag);
66 const PipelinePass &get_pass(const Tag &tag) const;
68 void add_renderable(const Renderable &);
69 void add_renderable_for_pass(const Renderable &, const Tag &);
70 void remove_renderable(const Renderable &);
71 void add_effect(Effect &);
72 void add_postprocessor(PostProcessor &);
74 virtual void render(Renderer &, const Tag &tag = Tag()) const;
75 void render_all() const;