]> git.tdb.fi Git - libs/gl.git/blobdiff - source/pipeline.h
Handle clipping in Pipeline and Renderer
[libs/gl.git] / source / pipeline.h
index f8fdb5450b18d42eb621ff0fb80141918b9ecbc8..2c61a53791ae02ce36e3aa8c97cc68fda3b94b95 100644 (file)
@@ -13,6 +13,7 @@ namespace GL {
 
 class Blend;
 class Camera;
+class Clipping;
 class DepthTest;
 class Lighting;
 class PostProcessor;
@@ -49,6 +50,7 @@ public:
                const Lighting *lighting;
                const DepthTest *depth_test;
                const Blend *blend;
+               const Clipping *clipping;
 
        public:
                Pass(const Tag &);
@@ -58,9 +60,11 @@ public:
                void set_lighting(const Lighting *);
                void set_depth_test(const DepthTest *);
                void set_blend(const Blend *);
+               void set_clipping(const Clipping *);
                const Lighting *get_lighting() const { return lighting; }
                const DepthTest *get_depth_test() const { return depth_test; }
                const Blend *get_blend() const { return blend; }
+               const Clipping *get_clipping() const { return clipping; }
        };
 
 private:
@@ -102,6 +106,7 @@ private:
        unsigned samples;
        RenderTarget *target[2];
        MultisampleTarget *target_ms;
+       mutable bool in_frame;
 
 public:
        Pipeline(unsigned, unsigned, bool = false);
@@ -118,11 +123,14 @@ public:
        void remove_renderable(const Renderable &);
        void add_postprocessor(PostProcessor &);
 
+       virtual void setup_frame() const;
+       virtual void finish_frame() const;
+
        virtual void render(const Tag &tag = Tag()) const;
        virtual void render(Renderer &, const Tag &tag = Tag()) const;
 
 private:
-       void create_targets(bool);
+       void create_targets(unsigned);
 };
 
 } // namespace GL