]> git.tdb.fi Git - libs/gl.git/blob - source/pipeline.h
Style update: add spaces around assignment operators
[libs/gl.git] / source / pipeline.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2009  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_PIPELINE_H_
9 #define MSP_GL_PIPELINE_H_
10
11 #include <map>
12 #include "pipelinepass.h"
13 #include "renderable.h"
14
15 namespace Msp {
16 namespace GL {
17
18 class Camera;
19 class Effect;
20 class Framebuffer;
21 class PostProcessor;
22 class Renderbuffer;
23 class Texture2D;
24
25 class Pipeline: public Renderable
26 {
27 private:
28         typedef std::map<Tag, PipelinePass> PassMap;
29
30         PassMap passes;
31         std::vector<Tag> pass_order;
32         const Camera *camera;
33         std::vector<const Renderable *> renderables;
34         std::vector<Effect *> effects;
35         std::vector<PostProcessor *> postproc;
36         unsigned width;
37         unsigned height;
38         bool hdr;
39         Framebuffer *fbo;
40         Texture2D *color_buf;
41         Renderbuffer *depth_buf;
42
43 public:
44         Pipeline(unsigned, unsigned, bool);
45         ~Pipeline();
46
47         void set_camera(const Camera *);
48
49         PipelinePass &add_pass(const Tag &tag);
50         PipelinePass &get_pass(const Tag &tag);
51         const PipelinePass &get_pass(const Tag &tag) const;
52
53         void add_renderable(const Renderable &);
54         void add_effect(Effect &);
55         void add_postprocessor(PostProcessor &);
56
57         virtual void render(const Tag &tag = Tag()) const;
58         void render_all() const;
59 };
60
61 } // namespace GL
62 } // namespace Msp
63
64 #endif