]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderbuffer.h
Rework Bind and enable it to restore the old binding
[libs/gl.git] / source / renderbuffer.h
index 040dad44bfdbaf896194d1c9bdf9adf579d0b768..b88db17a8a25a6417835290c1caf8fc0273d3712 100644 (file)
@@ -8,8 +8,8 @@ Distributed under the LGPL
 #ifndef MSP_GL_RENDERBUFFER_H_
 #define MSP_GL_RENDERBUFFER_H_
 
+#include "bindable.h"
 #include "pixelformat.h"
-#include "types.h"
 
 namespace Msp {
 namespace GL {
@@ -21,24 +21,26 @@ correctly but that is not needed as a texture later.
 
 Requires the GL_EXT_framebuffer_object extension.
 */
-class Renderbuffer
+class Renderbuffer: public Bindable<Renderbuffer>
 {
 private:
-       uint id;
-       sizei width;
-       sizei height;
+       unsigned id;
+       unsigned width;
+       unsigned height;
 
 public:
        Renderbuffer();
        ~Renderbuffer();
 
-       uint get_id() const { return id; }
-       sizei get_width() const { return width; }
-       sizei get_height() const { return height; }
+       unsigned get_id() const { return id; }
+       unsigned get_width() const { return width; }
+       unsigned get_height() const { return height; }
+
+       void storage(PixelFormat fmt, unsigned width, unsigned height);
 
        void bind() const;
 
-       void storage(PixelFormat fmt, sizei width, sizei height);
+       static void unbind();
 };
 
 } // namespace GL