]> git.tdb.fi Git - libs/gl.git/blobdiff - source/framebuffer.cpp
Add post-processing effect framework
[libs/gl.git] / source / framebuffer.cpp
index 97a0147d4d3e2966777f715cd537022976a44a1c..7ae391a4a18c600dfe68c7461419dcaf3928d412 100644 (file)
@@ -30,7 +30,7 @@ Framebuffer::~Framebuffer()
 void Framebuffer::bind() const
 {
        glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, id);
-       current=this;
+       cur_fbo=this;
 }
 
 void Framebuffer::attach(FramebufferAttachment attch, Renderbuffer &rbuf)
@@ -51,22 +51,27 @@ FramebufferStatus Framebuffer::check_status() const
        return static_cast<FramebufferStatus>(glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT));
 }
 
+const Framebuffer *Framebuffer::current()
+{
+       return cur_fbo;
+}
+
 void Framebuffer::unbind()
 {
-       if(current)
+       if(cur_fbo)
        {
                glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
-               current=0;
+               cur_fbo=0;
        }
 }
 
 void Framebuffer::maybe_bind() const
 {
-       if(current!=this)
+       if(cur_fbo!=this)
                bind();
 }
 
-const Framebuffer *Framebuffer::current=0;
+const Framebuffer *Framebuffer::cur_fbo=0;
 
 } // namespace GL
 } // namespace Msp