]> git.tdb.fi Git - libs/gl.git/blob - source/renderbuffer.h
Add get_width() / get_height() methods to Renderbuffer and Framebuffer
[libs/gl.git] / source / renderbuffer.h
1 /* $Id$
2
3 This file is part of libmspgl
4 Copyright © 2007  Mikko Rasa, Mikkosoft Productions
5 Distributed under the LGPL
6 */
7
8 #ifndef MSP_GL_RENDERBUFFER_H_
9 #define MSP_GL_RENDERBUFFER_H_
10
11 #include "pixelformat.h"
12 #include "types.h"
13
14 namespace Msp {
15 namespace GL {
16
17 /**
18 A Renderbuffer contains a single renderable image.  It can be attached to a
19 Framebuffer to provide a logical buffer that is required to render the scene
20 correctly but that is not needed as a texture later.
21
22 Requires the GL_EXT_framebuffer_object extension.
23 */
24 class Renderbuffer
25 {
26 private:
27         uint id;
28         sizei width;
29         sizei height;
30
31 public:
32         Renderbuffer();
33         ~Renderbuffer();
34
35         uint get_id() const { return id; }
36         sizei get_width() const { return width; }
37         sizei get_height() const { return height; }
38
39         void bind() const;
40
41         void storage(PixelFormat fmt, sizei width, sizei height);
42 };
43
44 } // namespace GL
45 } // namespace Msp
46
47 #endif