]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/view.h
Don't store a View's target framebuffer in the base class
[libs/gl.git] / source / render / view.h
index 23425a86e3dff251322f219c6a337bac27e3bd0d..b7cb2256e937a6ef014415ae635c31d7d4e2b7fd 100644 (file)
@@ -20,17 +20,16 @@ Sequence can be used to specify other tags and add post-processing.
 class View
 {
 protected:
-       Framebuffer ⌖
        Camera *camera;
        Renderable *content;
        Renderer *internal_renderer;
 
-       View(Framebuffer &);
+       View();
 public:
        virtual ~View();
 
-       virtual unsigned get_width() const { return target.get_width(); }
-       virtual unsigned get_height() const { return target.get_height(); }
+       virtual unsigned get_width() const { return get_target().get_width(); }
+       virtual unsigned get_height() const { return get_target().get_height(); }
        float get_aspect_ratio() const { return static_cast<float>(get_width())/get_height(); }
 
        /** Sets the camera to render with.  The camera's aspect ratio is set to
@@ -41,6 +40,8 @@ public:
 
        virtual void render();
        virtual void render(Renderer &);
+protected:
+       virtual const Framebuffer &get_target() const = 0;
 };
 
 } // namespace GL