Commit 05f87557 authored by Utkarsh Ayachit's avatar Utkarsh Ayachit
Browse files

vtkOpenGLRenderWindow: bind default frame buffer

vtkOpenGLRenderWindow never bound the default frame buffer when
rendering began. While this is generally not necessary, if for some
reason the bound frame buffer is changed then vtkOpenGLRenderWindow ends
up rendering to incorrect frame buffer. Fixed that.
parent 2a3b0cca
...@@ -1276,8 +1276,7 @@ void vtkOpenGLRenderWindow::Start() ...@@ -1276,8 +1276,7 @@ void vtkOpenGLRenderWindow::Start()
this->BackRightBuffer = buffer; this->BackRightBuffer = buffer;
this->FrontRightBuffer = buffer; this->FrontRightBuffer = buffer;
} }
else if (!this->UseOffScreenBuffers && this->OffScreenFramebufferBound)
if (!this->UseOffScreenBuffers && this->OffScreenFramebufferBound)
{ {
this->OffScreenFramebuffer->RestorePreviousBindingsAndBuffers(); this->OffScreenFramebuffer->RestorePreviousBindingsAndBuffers();
this->OffScreenFramebufferBound = false; this->OffScreenFramebufferBound = false;
...@@ -1288,6 +1287,11 @@ void vtkOpenGLRenderWindow::Start() ...@@ -1288,6 +1287,11 @@ void vtkOpenGLRenderWindow::Start()
this->BackBuffer = static_cast<unsigned int>(GL_BACK); this->BackBuffer = static_cast<unsigned int>(GL_BACK);
this->FrontBuffer = static_cast<unsigned int>(GL_FRONT); this->FrontBuffer = static_cast<unsigned int>(GL_FRONT);
} }
else
{
// makes sense to activate the default framebuffer.
glBindFramebuffer(GL_FRAMEBUFFER, this->GetDefaultFrameBufferId());
}
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment