]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderbuffer.h
Use DevIL for loading images
[libs/gl.git] / source / renderbuffer.h
diff --git a/source/renderbuffer.h b/source/renderbuffer.h
new file mode 100644 (file)
index 0000000..a9c25ad
--- /dev/null
@@ -0,0 +1,43 @@
+/* $Id$
+
+This file is part of libmspgl
+Copyright © 2007  Mikko Rasa, Mikkosoft Productions
+Distributed under the LGPL
+*/
+
+#ifndef MSP_GL_RENDERBUFFER_H_
+#define MSP_GL_RENDERBUFFER_H_
+
+#include "pixelformat.h"
+#include "types.h"
+
+namespace Msp {
+namespace GL {
+
+/**
+A Renderbuffer contains a single renderable image.  It can be attached to a
+Framebuffer to provide a logical buffer that is required to render the scene
+correctly but that is not needed as a texture later.
+
+Requires the GL_EXT_framebuffer_object extension.
+*/
+class Renderbuffer
+{
+private:
+       uint id;
+
+public:
+       Renderbuffer();
+       ~Renderbuffer();
+
+       uint get_id() const { return id; }
+
+       void bind() const;
+
+       void storage(PixelFormat fmt, sizei width, sizei height);
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif