]> git.tdb.fi Git - libs/gl.git/blobdiff - source/pipeline.h
Process MemberAccess nodes in FunctionInliner
[libs/gl.git] / source / pipeline.h
index b450d0a5864ab76adcde1f92c1442a94b37fac89..0d38aaec40181ca402b896c1bf5a4530cb266fb7 100644 (file)
@@ -18,6 +18,7 @@ class Clipping;
 class DepthTest;
 class Lighting;
 class PostProcessor;
+class View;
 
 /**
 Top-level content class.  Typically a Pipeline is used as the content
@@ -75,7 +76,7 @@ private:
        PassList passes;
        const Camera *camera;
        std::vector<Slot> renderables;
-       std::vector<PostProcessor *> postproc;
+       std::vector<RefPtr<PostProcessor> > postproc;
        unsigned width;
        unsigned height;
        bool hdr;
@@ -85,11 +86,24 @@ private:
 
 public:
        Pipeline(unsigned, unsigned, bool = false);
+       Pipeline(const View &);
+       Pipeline(const Framebuffer &);
+private:
+       void init(unsigned, unsigned);
+public:
        ~Pipeline();
 
+       /* Sets high dynamic range mode.  Requires floating-point texture support.
+       A ColorCurve postprocessor is recommended for full benefit. */
        void set_hdr(bool);
+
        void set_multisample(unsigned);
 
+       unsigned get_width() const { return width; }
+       unsigned get_height() const { return height; }
+       bool get_hdr() const { return hdr; }
+       unsigned get_multisample() const { return samples; }
+
        // Deprecated
        void set_camera(const Camera *);
        Pass &add_pass(const Tag &tag);
@@ -104,10 +118,19 @@ public:
        /** Adds a postprocessor to the pipeline. */
        void add_postprocessor(PostProcessor &);
 
-       virtual void setup_frame() const;
-       virtual void finish_frame() const;
+       /** Adds a postprocessor to the pipeline, transferring ownership.  The
+       postprocessor will be deleted together with with pipeline.  It is also
+       deleted if this call throws an exception. */
+       void add_postprocessor_owned(PostProcessor *);
+
+private:
+       void add_postprocessor(PostProcessor *, bool);
+
+public:
+       virtual void setup_frame(Renderer &);
+       virtual void finish_frame();
 
-       void render() const;
+       void render();
        virtual void render(Renderer &, const Tag &tag = Tag()) const;
 
 private: