X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fframebuffer.cpp;h=7ae391a4a18c600dfe68c7461419dcaf3928d412;hb=119d9819ac9e9a8d274d2410beffe54e470485a3;hp=97a0147d4d3e2966777f715cd537022976a44a1c;hpb=dc1d1159a61f378bda11e5989ad694a86b9a3c77;p=libs%2Fgl.git diff --git a/source/framebuffer.cpp b/source/framebuffer.cpp index 97a0147d..7ae391a4 100644 --- a/source/framebuffer.cpp +++ b/source/framebuffer.cpp @@ -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(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