]> 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 2e1b367791f7f7065d0634df1845a1854876b050..9fe59bf774b929474869cb2f5ba60b3970ba6804 100644 (file)
@@ -2,7 +2,6 @@
 #define MSP_GL_FRAMEBUFFER_H_
 
 #include <vector>
-#include "bindable.h"
 #include "gl.h"
 #include "texturecube.h"
 #include <msp/gl/extensions/arb_geometry_shader4.h>
@@ -13,9 +12,9 @@
 namespace Msp {
 namespace GL {
 
-class Renderbuffer;
 class Texture;
 class Texture2D;
+class Texture2DMultisample;
 class Texture3D;
 class WindowView;
 
@@ -64,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.
@@ -76,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();
        };
@@ -110,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);