]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/framebuffer.h
Adapt to changes in mspmath
[libs/gl.git] / source / core / framebuffer.h
index fd7b8eb4d17ccffd2f829182dd55d52837187dcb..5476596317000dbecd53eca3146adce3dcc4407c 100644 (file)
@@ -5,6 +5,7 @@
 #include "color.h"
 #include "framebuffer_backend.h"
 #include "frameformat.h"
+#include "rect.h"
 #include "texturecube.h"
 
 namespace Msp {
@@ -47,9 +48,10 @@ protected:
 
        FrameFormat format;
        std::vector<Attachment> attachments;
-       unsigned width;
-       unsigned height;
-       mutable unsigned dirty;
+       unsigned width = 0;
+       unsigned height = 0;
+       unsigned layers = 0;
+       mutable unsigned dirty = 0;
 
        Framebuffer(bool);
 public:
@@ -71,6 +73,8 @@ public:
 
        unsigned get_width() const { return width; }
        unsigned get_height() const { return height; }
+       Rect get_rect() const { return Rect(0, 0, width, height); }
+       unsigned get_layers() const { return layers; }
 
 protected:
        void update() const;
@@ -99,6 +103,9 @@ public:
        void attach_layered(FrameAttachment attch, TextureCube &, unsigned level = 0);
        void detach(FrameAttachment attch);
 
+       const Texture *get_attachment(FrameAttachment) const;
+       const Texture *get_attachment(unsigned) const;
+
        /** Ensures that the framebuffer is complete, throwing an exception if it
        isn't. */
        void require_complete() const;