Commit 0994d6ca authored by Burlen Loring's avatar Burlen Loring
Browse files

OpenGL error hunt -- dashboard cleanup

Test for context in vtkFrameBufferObject when Get'ing
FBO attributes. This prevents driver segfault in
TestSetGet.tcl on Apple.

Change-Id: If093750770a5a55ac3cd69eaa0a7d8115e2d3771
parent e07e9824
...@@ -529,17 +529,27 @@ void vtkFrameBufferObject::CreateColorBuffers( ...@@ -529,17 +529,27 @@ void vtkFrameBufferObject::CreateColorBuffers(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
unsigned int vtkFrameBufferObject::GetMaximumNumberOfActiveTargets() unsigned int vtkFrameBufferObject::GetMaximumNumberOfActiveTargets()
{ {
GLint maxbuffers; unsigned int result = 0;
glGetIntegerv(vtkgl::MAX_DRAW_BUFFERS, &maxbuffers); if (this->Context)
return static_cast<unsigned int>(maxbuffers); {
GLint maxbuffers;
glGetIntegerv(vtkgl::MAX_DRAW_BUFFERS, &maxbuffers);
result = static_cast<unsigned int>(maxbuffers);
}
return result;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
unsigned int vtkFrameBufferObject::GetMaximumNumberOfRenderTargets() unsigned int vtkFrameBufferObject::GetMaximumNumberOfRenderTargets()
{ {
GLint maxColorAttachments; unsigned int result = 0;
glGetIntegerv(vtkgl::MAX_COLOR_ATTACHMENTS_EXT,&maxColorAttachments); if (this->Context)
return static_cast<unsigned int>(maxColorAttachments); {
GLint maxColorAttachments;
glGetIntegerv(vtkgl::MAX_COLOR_ATTACHMENTS_EXT,&maxColorAttachments);
result = static_cast<unsigned int>(maxColorAttachments);
}
return result;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
......
Markdown is supported
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