From c8bf408b572bd9f37976ca7d2c1fbca29615e33f Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 28 Jan 2017 11:02:24 +0700 Subject: [PATCH] Reset CachedBindFramebuffer when a frame buffer deleted. --- src/Graphics/OpenGLContext/opengl_ContextImpl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp b/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp index 73762463..b810cfb1 100644 --- a/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp +++ b/src/Graphics/OpenGLContext/opengl_ContextImpl.cpp @@ -226,8 +226,10 @@ graphics::ObjectHandle ContextImpl::createFramebuffer() void ContextImpl::deleteFramebuffer(graphics::ObjectHandle _name) { u32 fbo(_name); - if (fbo != 0) + if (fbo != 0) { glDeleteFramebuffers(1, &fbo); + m_cachedFunctions->getCachedBindFramebuffer()->reset(); + } } void ContextImpl::bindFramebuffer(graphics::Parameter _target, graphics::ObjectHandle _name)