X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpipeline.h;h=e8ffaf5ee46f3bcc3500143769e9c4ab2744ab42;hp=35d10a41c6f5a6f3521ade05f0066a4218bebbb3;hb=39488946c441f4007396e438f522609a8b2943ce;hpb=6109322ffc5dec1a777807fcbefacafe94d1d5eb diff --git a/source/pipeline.h b/source/pipeline.h index 35d10a41..e8ffaf5e 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,8 +98,17 @@ 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); + 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); @@ -112,6 +123,15 @@ 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();