]> git.tdb.fi Git - libs/gl.git/blob - source/renderbuffer.h
Drop Id tags and copyright notices from files
[libs/gl.git] / source / renderbuffer.h
1 #ifndef MSP_GL_RENDERBUFFER_H_
2 #define MSP_GL_RENDERBUFFER_H_
3
4 #include "bindable.h"
5 #include "pixelformat.h"
6
7 namespace Msp {
8 namespace GL {
9
10 /**
11 A Renderbuffer contains a single renderable image.  It can be attached to a
12 Framebuffer to provide a logical buffer that is required to render the scene
13 correctly but that is not needed as a texture later.
14
15 Requires the GL_EXT_framebuffer_object extension.
16 */
17 class Renderbuffer: public Bindable<Renderbuffer>
18 {
19 private:
20         unsigned id;
21         unsigned width;
22         unsigned height;
23
24 public:
25         Renderbuffer();
26         ~Renderbuffer();
27
28         unsigned get_id() const { return id; }
29         unsigned get_width() const { return width; }
30         unsigned get_height() const { return height; }
31
32         void storage(PixelFormat fmt, unsigned width, unsigned height);
33         void storage_multisample(unsigned, PixelFormat fmt, unsigned, unsigned);
34
35         void bind() const;
36
37         static void unbind();
38 };
39
40 } // namespace GL
41 } // namespace Msp
42
43 #endif