X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpipeline.h;h=85179b7d5abfb4c4263c39176b53d6fd26a0a7a5;hb=7cbe8cc9893fe14f889321bd55e78b0ed6503e23;hp=592c3caebebccd7d986250a8c5cc4f440880a9f6;hpb=8f2430208cfa7bb9dc5bd655dde88acc21db54d2;p=libs%2Fgl.git diff --git a/source/pipeline.h b/source/pipeline.h index 592c3cae..85179b7d 100644 --- a/source/pipeline.h +++ b/source/pipeline.h @@ -1,14 +1,8 @@ -/* $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" @@ -16,7 +10,6 @@ namespace Msp { namespace GL { class Camera; -class Effect; class Framebuffer; class PostProcessor; class Renderbuffer; @@ -25,25 +18,38 @@ class Texture2D; class Pipeline: public Renderable { private: + struct Slot + { + const Renderable *renderable; + std::set passes; + + Slot(const Renderable *); + }; + typedef std::map PassMap; PassMap passes; std::vector pass_order; const Camera *camera; - std::vector renderables; - std::vector effects; + std::vector renderables; 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); @@ -51,11 +57,15 @@ public: const PipelinePass &get_pass(const Tag &tag) const; void add_renderable(const Renderable &); - void add_effect(Effect &); + void add_renderable_for_pass(const Renderable &, const Tag &); + void remove_renderable(const Renderable &); 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