]> git.tdb.fi Git - libs/gl.git/blobdiff - source/framebuffer.h
Rework ProgramData to do less unnecessary work
[libs/gl.git] / source / framebuffer.h
index e25967aca41ddfd6b29bfa6aae211e473e1807f2..f34ecf5c6eeea0204eaa685dfee5e7f4537e75b9 100644 (file)
@@ -5,6 +5,7 @@
 #include "bindable.h"
 #include "gl.h"
 #include "texturecube.h"
+#include <msp/gl/extensions/ext_framebuffer_object.h>
 
 namespace Msp {
 namespace GL {
@@ -97,10 +98,21 @@ private:
                void clear();
        };
 
+       struct Viewport
+       {
+               int left;
+               int bottom;
+               unsigned width;
+               unsigned height;
+
+               Viewport();
+       };
+
        unsigned id;
        std::vector<Attachment> attachments;
        unsigned width;
        unsigned height;
+       Viewport view;
        mutable unsigned dirty;
 
        Framebuffer(unsigned);
@@ -130,6 +142,9 @@ public:
        isn't. */
        void require_complete() const;
 
+       void viewport(int, int, unsigned, unsigned);
+       void reset_viewport();
+
        void clear(BufferBits);
 
        /** Blits a region from another framebuffer into this one.  If the source