X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpipeline.h;h=bc793887695b2db51676d979522faf7f680842fc;hp=19bea10a641d9664992013758b1c17a5ec709243;hb=f14435e58bfa0fa697a06ba9a454bb30cd37d9d8;hpb=e17243fb2421977cb781361828b77718e2cf8d48 diff --git a/source/pipeline.h b/source/pipeline.h index 19bea10a..bc793887 100644 --- a/source/pipeline.h +++ b/source/pipeline.h @@ -1,20 +1,15 @@ -/* $Id$ - -This file is part of libmspgl -Copyright © 2009 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - #ifndef MSP_GL_PIPELINE_H_ #define MSP_GL_PIPELINE_H_ #include +#include #include "pipelinepass.h" #include "renderable.h" namespace Msp { namespace GL { +class Camera; class Effect; class Framebuffer; class PostProcessor; @@ -24,33 +19,56 @@ class Texture2D; class Pipeline: public Renderable { private: - std::map passes; + struct Slot + { + const Renderable *renderable; + std::set passes; + + Slot(const Renderable *); + }; + + typedef std::map PassMap; + + PassMap passes; std::vector pass_order; - std::vector renderables; + const Camera *camera; + std::vector renderables; std::vector effects; std::vector postproc; unsigned width; unsigned height; bool hdr; + unsigned samples; Framebuffer *fbo; Texture2D *color_buf; - Renderbuffer *depth_buf; + Texture2D *depth_buf; + Framebuffer *fbo_ms; + Renderbuffer *color_buf_ms; + Renderbuffer *depth_buf_ms; public: - Pipeline(unsigned, unsigned, bool); + Pipeline(unsigned, unsigned, bool = false); ~Pipeline(); + void set_hdr(bool); + void set_multisample(unsigned); + void set_camera(const Camera *); + PipelinePass &add_pass(const Tag &tag); PipelinePass &get_pass(const Tag &tag); const PipelinePass &get_pass(const Tag &tag) const; - virtual bool has_pass(const Tag &tag) const; void add_renderable(const Renderable &); + void add_renderable_for_pass(const Renderable &, const Tag &); + void remove_renderable(const Renderable &); void add_effect(Effect &); void add_postprocessor(PostProcessor &); - virtual void render(const Tag &tag=Tag()) const; + virtual void render(Renderer &, const Tag &tag = Tag()) const; void render_all() const; + +private: + void create_fbos(); }; } // namespace GL