X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpipeline.h;h=dd80ef3bb1563d475e1ab9d606444187047b4b6d;hb=df20a7e137542a4156cc5ffa8118d59de6b68547;hp=35d10a41c6f5a6f3521ade05f0066a4218bebbb3;hpb=6109322ffc5dec1a777807fcbefacafe94d1d5eb;p=libs%2Fgl.git diff --git a/source/pipeline.h b/source/pipeline.h index 35d10a41..dd80ef3b 100644 --- a/source/pipeline.h +++ b/source/pipeline.h @@ -76,10 +76,11 @@ private: PassList passes; const Camera *camera; std::vector renderables; - std::vector postproc; + std::vector > postproc; unsigned width; unsigned height; bool hdr; + bool alpha; unsigned samples; RenderTarget *target[2]; RenderTarget *target_ms; @@ -87,6 +88,7 @@ private: public: Pipeline(unsigned, unsigned, bool = false); Pipeline(const View &); + Pipeline(const Framebuffer &); private: void init(unsigned, unsigned); public: @@ -96,14 +98,16 @@ public: A ColorCurve postprocessor is recommended for full benefit. */ void set_hdr(bool); + /* Enable or disable alpha channel. When enabled, all render targets are + created with an RGBA pixel format instead of RGB. */ + void set_alpha(bool); + void set_multisample(unsigned); - // Deprecated - void set_camera(const Camera *); - Pass &add_pass(const Tag &tag); - void add_renderable(Renderable &); - void add_renderable_for_pass(Renderable &, const Tag &); - void remove_renderable(Renderable &); + unsigned get_width() const { return width; } + unsigned get_height() const { return height; } + bool get_hdr() const { return hdr; } + unsigned get_multisample() const { return samples; } /** Adds a pass to the pipeline. It's permissible to add the same Renderable multiple times. */ @@ -112,10 +116,18 @@ public: /** Adds a postprocessor to the pipeline. */ void add_postprocessor(PostProcessor &); + /** 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(); virtual void render(Renderer &, const Tag &tag = Tag()) const; private: