]> git.tdb.fi Git - libs/gl.git/blobdiff - source/framebuffer.h
Rework Bind and enable it to restore the old binding
[libs/gl.git] / source / framebuffer.h
index 7c88b4cd105a7def770fc8d0b3ea404c6bac051c..b4f43f77f47473a12381eb499eb13a3c6d658c13 100644 (file)
@@ -9,6 +9,7 @@ Distributed under the LGPL
 #define MSP_GL_FRAMEBUFFER_H_
 
 #include <vector>
+#include "bindable.h"
 #include "gl.h"
 
 namespace Msp {
@@ -73,7 +74,7 @@ least one image must be attached for the framebuffer to be usable.
 
 Requires the GL_EXT_framebuffer_object extension.
 */
-class Framebuffer
+class Framebuffer: public Bindable<Framebuffer>
 {
 private:
        struct Attachment
@@ -96,7 +97,6 @@ private:
        unsigned width;
        unsigned height;
 
-       static const Framebuffer *cur_fbo;
        static int sys_viewport[4];
 
 public:
@@ -116,7 +116,6 @@ public:
        */
        FramebufferStatus check_status() const;
 
-       static const Framebuffer *current();
        static void unbind();
 private:
        void maybe_bind() const;