]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/framebuffer.h
Remove RenderBuffer and always use textures as framebuffer attachments
[libs/gl.git] / source / core / framebuffer.h
index 275f516e8d4d3b22acca3393a48065cb5d5422fb..9fe59bf774b929474869cb2f5ba60b3970ba6804 100644 (file)
@@ -12,9 +12,9 @@
 namespace Msp {
 namespace GL {
 
-class Renderbuffer;
 class Texture;
 class Texture2D;
+class Texture2DMultisample;
 class Texture3D;
 class WindowView;
 
@@ -63,8 +63,8 @@ common application is rendering to a texture, which can then be used for
 fullscreen shader effects.
 
 A framebuffer consist of a number of logical buffers, such as color and depth
-buffers.  Renderbuffers and Textures can be attached to the logical buffers.  At
-least one image must be attached for the framebuffer to be usable.
+buffers.  Textures can be attached to the logical buffers.  At least one image
+must be attached for the framebuffer to be usable.
 
 Requires the GL_EXT_framebuffer_object extension.  The blit functions require
 the GL_EXT_framebuffer_blit extension.
@@ -75,17 +75,11 @@ private:
        struct Attachment
        {
                FramebufferAttachment attachment;
-               GLenum type;
-               union
-               {
-                       Renderbuffer *rbuf;
-                       Texture *tex;
-               };
+               Texture *tex;
                unsigned level;
                int layer;
 
                Attachment(FramebufferAttachment);
-               void set(Renderbuffer &);
                void set(Texture &, unsigned, int);
                void clear();
        };
@@ -109,10 +103,10 @@ private:
        void update() const;
        void check_size();
        unsigned get_attachment_index(FramebufferAttachment);
-       void set_texture_attachment(FramebufferAttachment, Texture &, unsigned, int);
+       void set_attachment(FramebufferAttachment, Texture &, unsigned, int);
 public:
-       void attach(FramebufferAttachment attch, Renderbuffer &rbuf);
        void attach(FramebufferAttachment attch, Texture2D &tex, unsigned level = 0);
+       void attach(FramebufferAttachment attch, Texture2DMultisample &tex);
        void attach(FramebufferAttachment attch, Texture3D &tex, unsigned layer, unsigned level = 0);
        void attach(FramebufferAttachment attch, TextureCube &tex, TextureCubeFace face, unsigned level = 0);
        void attach_layered(FramebufferAttachment attch, Texture3D &tex, unsigned level = 0);